Patent ID: 7916207

Claim:
An apparatus comprising: a green interpolation unit configured to: receive an RGB bayer pattern from an image sensor; interpolate the RGB bayer pattern by replacing a value of an originally red or blue pixel with an average value of a first number of originally green pixels to form an original M×N green plane; determine a bad pixel if an evaluation pixel in the original M×N green plane satisfies an inequality condition; compensate the bad pixel to form a compensated M×N green plane by replacing the bad pixel value with an average of a second number of originally green pixels in the original M×N green plane; and interpolate the compensated M×N green plane by replacing a value of an originally red or blue pixel with an average value of a third number of originally green pixels in the compensated M×N green plane to form a final green plane; and a focus data generation unit configured to extract focus data from the final green plane, wherein the first number is at least three, the second number is at least four, and the third number is at least three, and wherein the first number is not equal to the second number and the first number is equal to the third number.