Patent ID: 8581999

Claim:
A method of performing eye correction in an electronic device comprising an image processor, an image sensor, and a storage device, the method comprising: the image sensor capturing image data; the image processor detecting a pet face in the image data; the image processor locating a plurality of candidate eye regions in the pet face; a classifier of the image processor verifying at least one eye region of the plurality of candidate eye regions; and the image processor recovering an abnormal pupil region of the at least one verified eye region by changing a color of each pixel in the abnormal pupil region to a dark color according to following formulas: Y new =40 ×B ( f p )+ Y old ×(1− B ( f p )); Cb new =Cb old ×(1 −B ( f p )); and Cr new =Cr old ×(1 −B ( f p )); where B ⁡ ( f p ) = P ⁡ ( f p | y = 1 ) ⁢ P ⁡ ( y = 1 ) P ⁡ ( f p | y = 1 ) ⁢ P ⁡ ( y = 1 ) + P ⁡ ( f p | y = 0 ) ⁢ P ⁡ ( y = 0 ) , f p is color intensity of the pixel, P(f p |y=1) is probability of the color intensity equaling f p when the pixel is abnormally-colored, P(y=1) is probability of the pixel being abnormally-colored, P(f p |y=0) is probability of the color intensity equaling f p when the pixel is not abnormally-colored, P(y=0) is probability of the pixel not being abnormally-colored, Y old is Y-component of the color, Y new is Y-component of the dark color, Cb old is Cb-component of the color, Cb new is Cb-component of the dark color, Cr new is Cr-component of the color, and Cr old is Cr-component of the dark color.