Patent ID: 7321394

Claim:
An automatic gain controller for an imaging system capable of producing successive frames of images, wherein said imaging system has an illumination source, said automatic gain controller comprising: means for receiving frames of images and converting each of said frames into pixels in which each pixel has a brightness value; means for counting the number of pixels of each frame of the image which have a brightness value above an upper threshold to provide a first value, the number of pixels of each frame of the image which have a brightness value below a lower threshold to provide a second value, and the total number of pixels of the frame; means for comparing the first value with a third value representing a first percentage of the counted total number of pixels, and comparing the second value with a fourth value representing a second percentage of the counted total number of pixels; and means for providing one or more signals to the imaging system capable of directing the imaging system in accordance with said comparing means to reduce the power to said illumination source when the first value is greater than the third value and the second value is greater than the fourth value, and to increase the power of said illumination source when the second value is less than the fourth value and the first value is less than the third value.