Imaging through scattering media has been a focus in research because of its meaningful applications in many fields. Recently, it has been proposed that high quality images can be recovered after passing through stationary scattering media by using the single-pixel imaging system based on compressed sensing. No doubt, it is a very interesting discovery about compressed sensing. However, it is also reported that high quality image can be recovered only with stationary scattering media. Mostly, the scattering media will not remain stationary, for example, the properties of the fog will be dynamically changed when their is wind. Thus, in a dynamic case, the transmittance of the scattering media will be nonlinear over the time, which will make the measured data nonlinear and the reconstructed image quality decrease. In this paper, a novel algorithm of linear transformation for measured data (LTMD) is proposed to make the nonlinear attenuation factor gain a linear transformation after passing through the dynamic scattering media. The factor is proposed from the theoretical calculus based on compressed sensing, and this correction factor can help to eliminate the nonlinear errors caused by dynamic scattering media and make the measured data linear. So the transformed data will greatly upgrade the reconstructed image quality. Simulation results show that high peak singnal to noise ratio images can still be recovered even when the dynamic frequency reaches 300 times in the 900 times of sampling. In experiments, plastic films are used as scattering media, and the number of films can be changed during the sampling to simulate the dynamic state of scattering media. With LTMD, high quality image with a resolution of 64 48 is recovered after passing through dynamic plastic films while the recovered result without LTMD is still hard to be distinguished. The traditional reconstructed algorithms orthogonal matching pursuit, Tval3 and L1-magic are also used in the experiments, and the image is still hard to recover with any of the three traditional algorithms. In a word, the proposed LTMD algorithm uses the correction factor to make the affected nonlinear-measured data linear, so as to increase the reconstructed quality of the imaging system based on the compressed sensing even when passing through scattering media with highly dynamic frequency.