Patent ID: 8189076

Claim:
A method for compensating image data, adapted for an image sensor, wherein the image sensor converts a light transmitted from a scene to image data, and the image sensor has a plurality of photo sensors arranged in an effective region and an optical black region, the method for compensating image data comprising: extracting a plurality of monochromatic light representative values S i corresponding to a plurality of pixel positions i from the photo sensors of the optical black region, wherein the monochromatic light representative values S i are average values of all intensity values of the same monochromatic light corresponding to the same pixel position i in the optical black region; extracting a plurality of monochromatic image intensity values V O from the photo sensors of the effective region; converting the monochromatic light representative values S i respectively to a plurality of monochromatic compensation values f(S i ), comprising: obtaining a weight value Wi based on a larger value Vmax in the two monochromatic image intensity values V O at the same pixel position i in the same Bayer pattern; obtaining a plurality of adjusted representative values S i ′ by looking up the monochromatic light representative values S i in a look-up table according to a pixel intensity of each of the pixel positions i; and obtaining the monochromatic compensation values f(S i ) by multiplying the adjusted representative values S i ′ respectively by the corresponding weight value W i based on the pixel position I; and outputting compensated image data V F after compensating the monochromatic image intensity values V O respectively based on the pixel positions i and the corresponding monochromatic compensation values f(S i ), wherein the photo sensors are provided with a plurality of color filters, the color filters are arranged in a Bayer pattern, and the monochromatic light representative values S i comprise a red (R) light representative value, two green (Gr, Gb) light representative values, and a blue (B) light representative value.