Patent Document ID: 8810696
Application ID: 14198484
Patent Status: 1

Claim One:
1. A blemish detection method, comprising the following steps: capturing a first image using an image sensor; adjusting the brightness of the first image to obtain a second image; calculating a brightness ratio of each pixel in the second image; marking the pixels of which the brightness ratios are greater than or equal to a predetermined reference value as “1”, and marking the other pixels as “0”; calculating the quantity of pixels in a continuous area in which all pixels are marked as “1”; and determining that the continuous area is a blemish if the quantity of pixels in the continuous area is greater than or equal to a predetermined pixel quantity; wherein the step of adjusting the brightness of the first image to obtain the second image comprises: calculating a first brightness value K 1 of each pixel in the first image based on a second degree parabola equation K 1 =(K 0 −S)(ar 2 +br+1)+S, wherein K 0 represents an initial brightness value of each pixel in the first image, a is 5×10 −14 , b is 7×10 −6 , r represents the square value of the pixel quantity between each pixel and a center pixel in the first image, and S is the optical black value of the image sensor; choosing whether to adjust the brightness of the first image according to the first brightness value; calculating a second brightness of each pixel if choosing not to adjust the brightness of the first image according to the first brightness value, wherein the second brightness of one pixel is calculated by dividing a sum of the first brightness of all pixels in a square pixel area with the total number of pixels in the square pixel area, the square pixel area has j×j pixels, the pixel is located at the center of the square pixel area; choosing whether to adjust the brightness of the first image according to the second brightness; calculating a third brightness value of each pixel in the first image if choosing not to adjust the brightness of the first image according to the second brightness value, wherein the third brightness of one pixel is calculated by: dividing the second brightness of the pixel by that of the center pixel to obtain a first coefficient of the pixel; selecting a number of successive pixels arranged in a line along the direction from the center pixel to the pixel; calculating the difference values of the first coefficients of every two adjacent pixels; calculating an average value of the difference values; subtracting the average value from the first coefficient of the pixel to obtain a second coefficient of the pixel; multiplying the second coefficient by the initial brightness of the pixel to obtain the third brightness of the pixel; and adjusting the brightness of the first image according to the third brightness value to obtain the second image.