This paper studied the influence law of image quality caused by different illumination methods and lighting intensity, proved the internal relationship between image quality and measuring accuracy. In order to control the lighting source automatically and ensure the measuring accuracy, the paper modeled the image quality assessment system under different illumination conditions and proposed a method to evaluate the image quality. That is, under the back light illumination, using the image contrast as the criterion while under the front light illumination, using the low frequency ratio as the criterion to evaluate the image quality. Through adjusting the contrast and low frequency ratio, the image quality can be controlled and the measuring accuracy can be satisfied.