The above objects and advantages of the present invention will become more readily apparent to those ordinarily skilled in the art after reviewing the following detailed description and accompanying drawings, in which:
For precisely reconstructing missing color data of a specified pixel so as to improve image quality, the present invention differentiates the interpolation algorithms according to color data conditions around the specified pixel.
Please refer to
Hereinafter, examples are given with Bayer patterns as illustrated in
Please refer to
In principle, the color data difference between two color components of a specified pixel will highly correlate to those of adjacent pixels in the same area. Therefore, the indices Cv and Ch can be calculated and the missing color data can be estimated according to such correlation, which will be described in detail by exemplifying the reconstruction of the color data G13 of the pixel P13.
For determining the vertical color data difference index Cv and horizontal color data difference index Ch, a first group of pixels adjacent to the pixel P13 are selected. In an embodiment of the present invention, the indices Cv and Ch are defined as follows:
The parameters e1, e2, e3, e4, e5, e6 and e7 are preset coefficients. GRv is a difference between green color data and red color data of the pixel P13, which is estimated according to a formula (3) to be described later. GRh is a difference between green color data and red color data of the pixel P13, which is estimated according to a formula (4) to be described later. GBv is a difference between green color data and blue color data of the pixel P13, which is estimated according to a formula (5) to be described later. GBh is a difference between green color data and blue color data of the pixel P13, which is estimated according to a formula (6) to be described later. GRavg is a difference between averaged green color data and averaged red color data of the Bayer pattern, which is estimated according to a formula (7) to be described later. GBavg is a difference between averaged green color data and averaged blue color data of the Bayer pattern, which is estimated according to a formula (8) to be described later. R3, R11, R13, R15 and R23 are detected red color data of pixels P3, P11, P13, P15 and P23. G8, G12, G14 and G18 are detected green color data of pixels P8, P12, P14 and P18. G7 and G9 are previously estimated green color data of pixels P7 and P9.
More specifically, the differences GRv and GRh are defined as follows.
GRv=Gv-R13=(k1*((G8-R3)+(G18-R23))+k2*((G8-R13)+(G18-R13)))/k3 (3) and
GRh=Gh-R13=(k1*((G12-R11)+(G14-R15))+k2*((G12-R13)+(G14-R13)))/k3 (4).
Gv and Gh are vertically and horizontally estimated color data G13 of the pixel 13, respectively. k1, k2 and k3 are preset coefficients. G8, G12, G14 and G18 are green color data of pixels P8, P12, P14 and P18. R3, R11, R15 and R23 are red color data of pixels P3, P11, P15 and P23.
Likewise, the differences GBv and GBh are defined as follows.
Bv and Bh are vertically and horizontally estimated color data B13 of the pixel 13, respectively. k4, k5, k6, k7 and k8 are preset coefficients. B7, B9, B17 and B19 are blue color data of pixels P7, P9, P17 and P19. G8, G12, G14 and G18 are green color data of pixels P8, P12, P14 and P18.
More specifically, the differences GRavg and GBavg are averaged green-red color difference and averaged green-blue color difference of the Bayer pattern, which are estimated according to green color data of 18 pixels, red color data of 14 pixels, and blue color data of 12 pixels.
a1˜a15 are preset coefficients. G1˜G12, G14, G16, G18, G20, G22 and G24 are detected or estimated green color data of pixels P1˜P12, P14, P16, P18, P20, P22 and P24. R1˜R6, R8, R11˜R13, R15, R21, R23 and R25 are detected or estimated red color data of pixels P1˜P6, P8, P11˜P13, P15, P21, P23 and P25. B1˜B10, B17 and B19 are detected or estimated blue color data of pixels P1˜P19, P17 and P19.
After the vertical color data difference index Cv and horizontal color data difference index Ch are realized, the indices Cv and Ch are compared with each other for determining which pixels to be used for reconstructing the color data of the pixel P13. The following three possible cases will be involved:
Gvs=s1*R13+s2*(s3*((G8-R3)+(G18-R23))+s4*((G8-R13)+(G18-R13)))/s5+s6*Bv+s7*GBavg (12);
Ghs=s1*R13+s2*(s3*((G12-R11)+(G14-R15))+s4*((G12-R13)+(G14-R13)))/s5+s6*Bh+s7*GBavg (13); and
G′=(G8+G12+G18+G14)/4 (14).
s1˜s7 are preset coefficients. (G8-R3), (G18-R23), (G8-R13) and (G18-R13) are green-red color differences between vertically adjacent pixels. (G12-R11), (G14-R15), (G12-R13) and (G14-R13) are green-red color differences between horizontally adjacent pixels. GBavg has been defined previously in equation (8). Bv and Bh can be calculated according to previously presented equations (5) and (6) and thus obtained as follows:
Bv=Gv-GBv=Gv+(k4*(B7-G12)+k5*(B17-G12)+k6*(B 9-G14)+k7*(B19-G14))/k8 (15); and
Bh=Gh-GBh=Gh+(k4*(B7-G8)+k5*(B17-G18)+k6*(B9-G8)+k7*(B19-G18))/k8 (16),
where Gv and Gh can be calculated according to previously presented equations (3) and (4) and thus obtained as follows:
Gv=GRv+R13=R13+(k1*((G8-R3)+(G18-R23))+k2*((G8-R13)+(G18-R13)))/k3 (17), and
Gh=GRh+R13=(k1*((G12-R11)+(G14-R15))+k2*((G12-R13)+(G14-R13)))/k3 (18).
After the green color data G13 of the pixel P13 is reconstructed, the missing blue color data B13 can be reconstructed according to the following formula:
B13=G13+(f1*((B7-G7)+(B9-G9)+(B17-G17)+(B 19-G19))+f2*((B8-G8)+(B14-G14)+(B18-G18)+(B12-G12)))/f3 (19).
f1, f2 and f3 are preset coefficients. B7, B8, B9, B12, B14, B17, B18 and B19 are detected or estimated blue color data of pixels P7, P8, P9, P12, P14, P17, P18 and P19. G7, G8, G9, G12, G14, G17, G18 and G19 are detected or estimated blue color data of pixels P7, P8, P9, P12, P14, P17, P18 and P19.
In this way, the missing blue color data and green color data of the center pixel P13 of the Bayer pattern of
Similar interpolation algorithms can be applied to a 5×5 Bayer pattern of
On the other hand, missing blue and red color data B13 and R13 of the pixel P13 of a 5×5 Bayer pattern with known green color data G13 as illustrated in
R13=G13+(w1*((R12-G12)+(R14-G14))+w2*((R8-G8)+(R18-G18)))/w3 (20); and
B13=G13+(w1*((B8-G8)+(B18-G18))+w2*((B12-G12)+(B14-G14)))/w3 (21).
w1, w2 and w3 are preset coefficients. R8, R12, R14 and R18 are detected or estimated red color data of pixels P8, P12, P14 and P18. G8, G12, G14 and G18 are detected or estimated green color data of pixels P8, P12, P14 and P18. B8, B12, B14 and B18 are detected or estimated blue color data of pixels P8, P12, P14 and P18.
The above-mentioned coefficients k1˜k8, a1˜a15, e1˜e7, s1˜s7, f1˜f3 and w1˜w3 can be determined according to the simulation utilizing a plurality of reference images. For example, an optimal set of coefficients can be obtained by calculating the minimum root mean square errors.
In the above example, the first group of pixels for determining the vertical color data difference index Cv and horizontal color data difference index Ch include the pixels at the same row (e.g. P11, P12, P14, P15) and the same column (e.g. P3, P8, P18, P23) as the pixel to be reconstructed, and other pixels (e.g. P7 and P9). When Cv−Ch<T, the second group of pixels including the pixels at the same column as the pixel to be reconstructed, e.g. P3, P8, P13, P18 and P23, and other pixels, e.g. P7, P9, P12, P14, P17 and P19, are used for determining the missing color data. On the other hand, when Cv−Ch>T, the third group of pixels including the pixels at the same row as the pixel to be reconstructed, e.g. P11, P12, P13, P14 and P15, and other pixels, e.g. P7, P8, P9, P17, P18 and P19, are used for determining the missing color data. Otherwise, when Cv−Ch=T, the fourth group of pixels including the pixels vertically and horizontally next to the pixel to be reconstructed, e.g. P8, P12, P14 and P18, are used for determining the missing color data.
For implementing the reconstructing method described above, a color data reconstructing device is provided according to the present invention. Please refer to
Since the present invention evaluates the minimum color difference and then utilizes different interpolation algorithms that involve difference pixels to reconstruct color data, the precision of the reconstructed color data can be improved. Moreover, the blurred edge problem can be significantly ameliorated.
While the invention has been described in terms of what is presently considered to be the most practical and preferred embodiments, it is to be understood that the invention needs not be limited to the disclosed embodiment. On the contrary, it is intended to cover various modifications and similar arrangements included within the spirit and scope of the appended claims which are to be accorded with the broadest interpretation so as to encompass all such modifications and similar structures.
Number | Date | Country | Kind |
---|---|---|---|
095132486 | Sep 2006 | TW | national |