This application claims the priority benefit of Taiwan application serial no. 95133604, filed on Sep. 12, 2006. All disclosure of the Taiwan application is incorporated herein by reference.
1. Field of the Invention
The present invention relates to an image processing method. More particularly, the present invention relates to an image processing method for solving pixel interference of an image.
2. Description of Related Art
Normally, image data can be the Bayer array data shown in
In the conventional art, such as the interpolation method disclosed by W. Li et al. (W. Li, P. Ogunbona, Y. Shi, and I. Kharitonenko, “CMOS Sensor Cross-Talk Compensation for Digital Cameras”, IEEE Trans. on Consumer Electronics, Vol. 48, No. 2, pp. 292-297, May 2002), G7 pixel in the Bayer array data shown in
Gnew7=G7+ΔG
where
ΔG7=(ΔG4+ΔG5+ΔG9+ΔGa)/4
ΔG4=G4−(G1+G2+G6+G7)/4
ΔG5=G5−(G2+G3+G7+G8)/4
ΔG9=G9−(G6+G7+Gb+Gc)/4
ΔGa=Ga−(G7+G8+Gc+Gd)/4
According to the above formulae, it is known that the compensation value is an average value of four surrounding Gb differential values, where each Gb differential value is obtained by subtracting the average value of four surrounding Gr values. As this method captures a great quantity of surrounding pixels to calculate the average values, when tiny line structures fall in the region, false color occurs around the lines and on the lines. Meanwhile, this method compensates one of the Gr or Gb pixels only, which makes the entire compensated image tend to be bluish or reddish. Moreover, W. Li et al. disclosed a second average value method in the same paper. Though the Gb and Gr pixels are compensated at the same time, this average value method still captures a great quantity of surrounding pixels to calculate the average values, and causes false color in tiny structures as well.
In addition, the interpolation method disclosed by C. Weerasinghe et al. (C. Weerasinghe, I. Kharitonenko, and P. Ogunbona, “Method of Color Interpolation in a Single Sensor Color Camera Using Green Channel Separation”, IEEE Proceeding 2002, pp. 3233-3236, 2002) regards a G7 pixel 30 in Bayer array data shown in
where, SMF (standard median filter) stands for a median value extraction filter. Therefore, a compensation value is obtained by extracting the median value of the G7 and the four surrounding Gb, and then the G7new is an average value of the median value and the G7. This method often extracts wrong median for tiny line structures, thus causing false color in the tiny line structures as well.
The present invention is directed to a method for compensating image array data, which effectively solves the problems concerning color deviation of images and false colors on tiny line structures or edges thereof. The image array data comprises a plurality of color pixels, and the color pixels at least comprise a plurality of first color pixels.
The method for compensating image array signals provided by the present invention comprises the following steps. One of the first color pixels is selected for further compensation. The color pixels horizontally adjacent to the selected first color pixel are second color pixels, and the color pixels vertically adjacent to the selected first color pixel are third color pixels. In addition, the first color pixels horizontally adjacent to the second color pixels in a predetermined region around the selected first color pixel are operated to obtain a first average value. Similarly, the first color pixels horizontally adjacent to the third color pixels in the predetermined region are operated to obtain a second average value. Thus, the present invention obtains a compensation value according to the first average value and the second average value, so as to compensate the selected first color pixel.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
β1=SMF(Gb02,Gb20,Gb22,Gb24,Gb42)
β2=SMF(Gb00,Gb04,Gb22,Gb40,Gb44)
β3=SMF(Gr11,Gr13,Gr33)
β4=SMF(Gr11,Gr31,Gr33)
Here, SMF refers to the operation of extracting the median value. Assuming Gb02>Gb20>Gb22>Gb24>Gb42, the output of the standard median filter is Gb22. Similarly, persons of ordinary skill in the art can sequentially determine the values of β2, β3, and β4. β1 and β2 reveal the edge information of the Gb pixels in this embodiment. On the other hand β3 and β4 reveal the edge information of the Gr pixels in this embodiment. Through the filter element distribution of the four standard median filters, the components of the tiny line structures falling in the Gb and Gr pixels are obtained respectively. Regardless whether the line structures in this embodiment are straight lines, oblique lines, right angles, V-shaped lines, or any other polygons, the tiny components of the Gb and Gr pixels can be obtained using the four standard median filters.
Then, the average value of β1 and β2 of the Gb pixels is obtained, i.e., the average value of the tiny structures in the Gb pixels is obtained, which is represented by d1 as follows.
similarly, the average value of β3 and β4 of the Gr pixels is obtained, i.e., the average value of the tiny structures in the Gr pixels is obtained, which is represented by d2 as follows.
Then the compensated Gb22 is calculated according to the formula below.
Gb22new=Gb22+(d2−d1)/2
The components of each of the compensated Gb and Gr pixels can be obtained by repeating the above steps.
To sum up, the method of the present invention compensates the interference of the pixels of the image sensor in the regions with uniform and smooth colors, on the tiny line structures and on the edges thereof, so as to suppress the occurrence of the false colors.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
95133604 A | Sep 2006 | TW | national |
Number | Name | Date | Kind |
---|---|---|---|
7116819 | Zhang | Oct 2006 | B2 |
20030214594 | Bezryadin | Nov 2003 | A1 |
20060050159 | Ahn | Mar 2006 | A1 |
20080158396 | Fainstain et al. | Jul 2008 | A1 |
Number | Date | Country |
---|---|---|
1245547 | Nov 2005 | TW |
Number | Date | Country | |
---|---|---|---|
20080063269 A1 | Mar 2008 | US |