Abstract The influence of uneven temperature distribution on imaging quality of computational ghost imaging (CGI) in the underwater environment is investigated experimentally. It is shown that as the water temperature increases, imaging quality presents a trend from deterioration to improvement. The results can be explained by the changes of the temperature difference between the upper and lower layers of underwater environment and laser spot travelling through the underwater environment. Moreover, the effect from different positions of the underwater environment with the same water temperature on CGI is also discussed.