Not applicable.
The present invention relates to a blue sky color detection technique.
Sky is an important subject matter seen in photographic images. The identification of sky in images facilitates its enhancement and image manipulation.
The most prominent characteristic of sky tends to be its color, which is usually light blue when the sky is clear. Such a characteristic has been used to detect sky in images.
There exists conventional techniques of enhancing the color of a color image. One technique involves image-dependent color saturation correction in a natural scene pictorial image disclosed in U.S. Pat. No. 5,450,217. In this method, color saturation is enhanced in an HSV color space, which is considered as being capable of representing an image to have almost the same saturation as a recognized saturation of the image. However, this method can enhance the color saturation of certain images only, which have an average saturation of no higher than a certain threshold value.
The foregoing and other objectives, features, and advantages of the invention will be more readily understood upon consideration of the following detailed description of the invention, taken in conjunction with the accompanying drawings.
A diagram illustrating a sky detection technique 10 is illustrated in
The low pass image, containing fewer details and artifacts which may be representative of sky regions is passed through an image enhancement technique so the image is more visually appealing to the viewer. The high pass image, containing high frequency details and artifacts is not passed through a similar enhancement technique so as avoid enhancing such artifacts which may be objectionable to the viewer. In this manner, the spatial regions of the image tending to include limited amount of details and noise and sky regions are enhanced, while the spatial regions of the image tending to include artifacts, noise and details are not similarly enhanced.
As previously noted, the sigma filter 20 decomposes the input image into the low pass image 30 and the high pass image 40. The sigma filter utilizes a one dimensional or two dimensional rectangular window, where the current pixel I(x,y) is at the center of the window. The sigma filter compares all (or a selected set of) the pixels I(i,j) in the window with the central pixel I(x,y) (or other suitable pixel), and averages those pixels whose value differences with the central pixel I(x,y) is within a threshold T. Because the filter drops pixels that are not within the threshold, this filter is generally referred to as a sigma filter and is non-linear. Mathematically, the output of the sigma filter 30, ILP(x,y), may be calculated as follows:
where E is the window; N(x,y) is the count of the pixels in E that satisfy the condition of |I(i,j)−I(x,y)|<T. The parameters of the sigma filter, the widow E and the threshold T, may be chosen using any technique, such as being selected empirically.
Because the sigma filter is also a smoothing filter preserving sharp edges, the low pass image generated by a sigma filter contains few high frequency details but does contain sharp edges, and the high pass image therefore contains details, noises, and artifacts but few sharp edges. The low-pass image, in general, tends to resemble a cartoon image. The preservation of sharp edges tends to assist in the identification of those regions that are likely to be sky colors.
Sky color detection 50 is based upon the low-pass image 30 from the sieve filter 20. Referring to
The sky color probability 100 is used to initialize a sky score look up table 110. The entries in the look up table 110 are adjusted based upon testing on a large set of sky and non-sky images. The adjustment of the look up table 110 involves fine tuning the sky score look up table 120, generating sky color likelihood map using the sky score look up table 130, and repeating the process until a suitable sky score look up table is created. The resulting sky score look up table is used as the basis for the sky color detection 50.
If the system directly uses the RGB color space for the look up tables, such as the table for the sky color detection 50, then the system would incorporate a three dimensional LUT. It is computationally complex to adjust a three dimensional LUT. To reduce the computational complexity it is desirable to modify the RGB color space to a different color space, such as the HSV (hue, saturation, value) color space. With the color space modification, the three dimensional lookup table may be replaced by four two-dimensional look up tables and two one-dimensional look up tables. It is more computationally efficient to adjust multiple two dimensional and one dimensional look up tables than a single three dimensional look up table.
One technique to modify the color space is to first divide the RGB color space into six areas, and then define hue (H), saturation (S) and value (V) separately in the six areas (note that while S and V are defined by the typical definition, H here has a nonstandard definition), and then define the sky score for each area. The blue-cyan area is described in detailed with the remaining areas being similar. The six color areas and S and H are illustrated in
The blue-cyan 300 (blue>green>red), may be defined as follows:
S and H are between 0 and 1. When S is 0, r=g=b and the color is the white; when S is 1, r is 0 and the color is most saturated. When H is 0, g=r and the color is blue; when H is 1, g=b and the color is cyan.
The sky score may be modeled by the following equation:
skyScoreRY(H,S,V)=ƒBC(S,H)·w(V)
Where ƒBC(S,H) models LUT function based on the S and H, and it is given by:
ƒBC(S,H)=((b−r)*p(b),(g−r)*q(b−r))
The above equation may be implemented by concatenation of one dimensional LUTs and two dimensional LUTs. The calculation uses one two dimensional LUTs for ƒBC(•,•), and two one dimensional LUTs for p(•) and q(•).
Calculating the sky score solely based on S and H may not reflect the true sky likelihood. For instance, if sky score is solely based on H and S, some low-luminance blue colors (Vis small and B>R&B>G, e.g. [R G B]=[45 47 50]) will typically receive very high sky score which should not be the case since perceptually these colors will look like black and therefore sky score shall be low such that only small saturation boosting is enforced. In this case the second component w(V) plays a role to pull down the high score assigned to the low-luminance blue colors. w(V) may be given as:
One embodiment of the w(V) is shown in
The two dimensional LUT ƒBC(•,•) is illustrated in
The blue-magenta 310 (blue>red>green) may be defined as follows:
The calculation uses a different two dimensional LUT for ƒBM(•,•), the same two one dimensional LUTs for p(•) and q(•) and the same w(V). The two dimensional LUT ƒBM(•,•) is illustrated in
The green-cyan 320 (green>blue>red), may be defined as follows:
The calculation uses a two dimensional LUT for ƒGC(•,•) and the same two one dimensional LUTs for p(•) and q(•). The two dimensional LUT ƒGC(•,•) is illustrated in
The green-yellow 330 (green>red>blue), may be defined as follows:
The calculation uses a two dimensional LUT for ƒGY(•,•) and the same two one dimensional LUTs for p(•) and q(•). The two dimensional LUT ƒGY(•,•) is illustrated in
The red-yellow 340 (red>green>blue), may be defined as follows:
The calculation uses a two dimensional LUT for ƒRY(•,•)=ƒGY(•,•) and the same two one dimensional LUTs for p(•) and q(•).
The two dimensional LUT ƒRY(•,•) is illustrated in
The red-magenta 350 (red>blue>green), may be defined as follows:
The calculation uses a 2D LUT for ƒRM(•,•)=ƒRY(•,•)=ƒGY(•,•) and the same two 1D LUTs for p(•) and q(•).
The two dimensional LUT •RM(•,•) is illustrated in
The sky score for the sRGB color gamut is illustrated in two dimensions in
The sky color detection 50 thus creates a sky color likelihood map 60 based upon the lowpass image 30 in combination with the two dimensional and one dimensional sky score look up tables 130. In general, the process for the sky color detection 50 is a pixel by pixel analysis of the lowpass image 30. However, if desired, the sky color detection 50 could include a spatial analysis.
The sky color likelihood map 60 tends to be not smooth which may cause undesirable artifacts (such as contouring artifacts) in the saturation-enhanced sky images 220. The system may use a filter 70, such as an image-driving non-linear lowpass filter to smooth the sky color likelihood map 60 to reduce potential contouring artifacts. Referring to
where x is the row index, y is the column index, and α0+α1+α2+α3+α4=1. The IIR filter may be implemented in such a manner that it only uses a one line buffer for the sky score, without requiring life buffers for the RGB.
An adjustable color enhancement 80 for the sky color may be performed. Referring to
The 3×3 matrix 90 and the DC offset 95 are generated by users according to their preference, and received by the system. There are many techniques that may be used to adjust the 3×3 matrix and DC offset. As a preferred embodiment, users can adjust hue, saturation and brightness in the YCbCr space, and then the adjustment parameters are converted to a new 3×3 matrix and DC offset. In this case, the 3×3 conversion matrix can be express as follows where a represents the luminance enhancement amount, β represents the saturation boosting amount, and θ represents the amount of hue angle rotation. As one embodiment the above equation, one sets α=1, βε[1 2], and θ=0. This way, one may achieve luminance and hue preservation while enhancing the saturation of the sky region.
One benefit of adjustable color enhancement is that it allows different viewer groups to readily adjust the amount of saturation to be enhanced, some viewer group preferring more saturated colors than the others can adjust the saturation boosting amount accordingly.
The output 200 is provided to a sky score based blending 210.
The enhanced image pixel output 220 of the sky score based blending 210 is a linear combination of the original input pixel 30 and the enhanced pixel 200 adjusted by the output 230 of the filter 70. It can be expressed as:
RGB_OUT(c)=skyScore(c)×RGB0n(c)+(1−skyScore(c))*RGB0(c)
This equation indicates that pixels with low sky color likelihood will not be enhanced too much, and the pixels with high sky color likelihood will be heavily enhanced.
To provide the final image, the high pass image 40 is added 240 to the sky score based blended image 220.
The terms and expressions which have been employed in the foregoing specification are used therein as terms of description and not of limitation, and there is no intention, in the use of such terms and expressions, of excluding equivalents of the features shown and described or portions thereof, it being recognized that the scope of the invention is defined and limited only by the claims which follow.
Number | Name | Date | Kind |
---|---|---|---|
5450217 | Eschbach et al. | Sep 1995 | A |
6504951 | Luo et al. | Jan 2003 | B1 |
6771311 | Weldy | Aug 2004 | B1 |
6856704 | Gallagher et al. | Feb 2005 | B1 |
7356193 | Gallagher | Apr 2008 | B2 |
7433104 | Cheo et al. | Oct 2008 | B2 |
7478091 | Mojsilovic et al. | Jan 2009 | B2 |
7853094 | Pan et al. | Dec 2010 | B2 |
7978910 | Bang et al. | Jul 2011 | B2 |
8238654 | Pan et al. | Aug 2012 | B2 |
20030053686 | Luo et al. | Mar 2003 | A1 |
20050147298 | Gallagher et al. | Jul 2005 | A1 |
20050195212 | Kurumisawa et al. | Sep 2005 | A1 |
20070110305 | Corcoran et al. | May 2007 | A1 |
20070171443 | Pan | Jul 2007 | A1 |
20070172118 | Pan | Jul 2007 | A1 |
20070172119 | Pan et al. | Jul 2007 | A1 |
20080166044 | Pan et al. | Jul 2008 | A1 |
20090024395 | Banba | Jan 2009 | A1 |
Number | Date | Country |
---|---|---|
1326425 | Aug 2008 | EP |
10-269360 | Oct 1998 | JP |
2005-012793 | Jan 2005 | JP |
2007-208979 | Aug 2007 | JP |
2009-060431 | Mar 2009 | JP |
WO 0299557 | Dec 2002 | WO |
Number | Date | Country | |
---|---|---|---|
20100284614 A1 | Nov 2010 | US |