The invention relates to a method for
self adaptation of a
CMOS (Complementary
Metal Oxide Semiconductor)
image sensor to an external
ray environment, which comprises the steps of: 1, initializing a
CMOS by a main controller and setting a preset
exposure parameter during initialization; 2, collecting a frame of empty original image and computing average gray; 3, judging whether the average
gray level is within a reasonable range, if so, skipping to a step 4; 4, regulating a
CMOS exposure parameter according to a result and returning to the step 2 if the average
gray level is not within the reasonable range; 5, waiting for a command for collecting an image and entering a step 6 after receiving the command; 6, collecting a frame of image by the CMOS by using the current parameter; 7, analyzing and judging the image by collected the CMOS, and returning to the step 6 if the image is not qualified; and 8,
processing the qualified image to finish equipment work. The method has the advantages of easiness in use, accuracy, real-time performance and stability, the easiness of the method in use lies in that the
self adaptation of equipment to the external environment does not need manual control, and the accuracy of the method ensures that the equipment performance related to the image aspect can be kept in an optimal state..