Patent ID: 8212891

Claim:
A method comprising: receiving image data from an image sensor, the image data including a portion corresponding to an object; counting a number of overexposed pixels to obtain a first count and a number of underexposed pixels to obtain a second count, in response to determining that the first count exceeds a first threshold or the second count exceeds a second threshold, setting an exposure for the image sensor to one of a plurality of first ranges based upon a comparison to a plurality of percentage thresholds, in response to determining that the first count did not exceed or the second count did not exceed the plurality of percentage thresholds and are greater than or less than an average pixel count, setting the exposure for the image sensor to one of a second plurality of ranges based upon a comparison to an average pixel count; determining distance of the object from the image sensor using the received image data; controlling exposure of the image sensor based upon the set exposure range; and compensating the exposure using the determined distance.