Patent ID: 7835588

Claim:
A device comprising: a camera configured to capture at least one image; a computer readable medium having computer-executable instructions that when executed by a processor in the device cause the device to perform: retrieve, from data for an image captured with the camera, a plurality of image pixel data values for at least one component of the image configured to form a histogram across a dynamic range having a plurality of mean values including a mean, a hi-mean, and a low-mean; stretch a predetermined amount of non-zero image pixel data values of the histogram to obtain at least a stretched mean, a stretched hi-mean, and a stretched low-mean; adjust the stretched mean towards the center of the dynamic range of the histogram to get a corrected stretched mean; utilize predetermined ratios between the corrected stretched mean and the ends of the dynamic range, adjust the stretched high mean to get a corrected stretched high mean and adjust the stretched low mean to obtain a corrected stretched low mean; form a piecewise linear mapping function that maps the corrected stretched low mean to target low mean values and the corrected stretched high mean to target high mean values; and compute gains of the piecewise linear function and reshape the dynamic range so that all of the gains computed are between predetermined minimum and maximum limits; and create a stretching look-up table of the image pixel data values.