This application claims priority under 35 U.S.C. §119 from an application entitled “Apparatus And Method For Adjusting White Balance In Digital Imaging device” filed with the Korean Intellectual Property Office on Feb. 12, 2008 and assigned Serial No. 2008-12777, the contents of which are incorporated herein by reference in its entirety.
1. Field of the Invention
The present invention relates to an imaging device. More particularly, the present invention relates to an apparatus and method for adjusting a white balance of an imaging device.
2. Description of the Related Art
Every light has its own color temperature value. A color temperature is a temperature representing the color of light emitted from a light source, and is generally expressed in Kelvin temperature measurement. For example, light rays of the sun, candlelight, and fluorescent lamps have different color temperature values. The reason why people hardly feel the differences between color temperatures is that human eyes have an excellent Auto White Balance function. The white balance represents relative intensities of red, green and blue colors of light emitted from a light source.
With respect to a camera, a low color temperature causes a captured image to be reddish, and a high color temperature causes a captured image to be bluish. The camera can obtain a normal color balance under sunlight. However, an image captured by the camera becomes reddish under a glow lamp or candle light, which has a lower color temperature than sunlight, and an image captured by the camera becomes bluish under a fluorescent lamp or in cloudy weather, which has a higher color temperature than sunlight. For this reason, a camera obtains a yellowish picture under a glow lamp, and obtains a bluish picture under a fluorescent lamp.
For example, adjusting a white balance may be regarded as a task of recording colors that a camera senses and receives through light on the actual spot in order to exactly express colors reflected by a subject. Generally, in order to settle discord of hues due to color temperatures, which are different depending on illumination states indoors or outdoors, an image pickup device in a camcorder or camera typically adjusts a white balance to obtain a visually smooth image in such a manner as to normally photograph a white-color chart or paper placed at a position of a subject and to balance hues in a bright portion of a screen. A white-color object is seen as a slightly different color depending on illuminations on the actual spots. Therefore, adjusting a white balance is a process of memorization that a color currently reflected by a white-color object corresponds originally to a white color in a camera.
Generally, a there is a known Von Kries method based on Gray World Assumption (GWA) is the most widely used for the white balance. The GWA is a theory that if all colors in the world are mixed an achromatic color is obtained, so that if various colors exist in an image, the mean value of all colors in the image results in an achromatic color. The achromatic color has only brightness, has no color component, and represents that the mean values of the respective RGB (Red, Green, Blue) channels are equal to each other. Adjusting the mean values obtained in the respective channels to be equal to each other based on the GWA is known as the Von Kries method.
In step 101, pixel values of the entire region/area of an original image photographed by a digital imaging device are detected. Then, in step 103, the mean value of the detected pixel values is calculated, and in step 105, the hue components of the calculated mean value are compared do determine whether the hue component is equal to each other. When it is determined at step 105 that the color components of the calculated mean value are not equal to each other, then step 107 is performed. In step 107, color component values according to pixels are adjusted to be equal to each other, and then step 109 is performed. In contrast, at step 105, when the color components of the calculated mean value are equal to each other, the method jumps to step 109 and performs the storage step. More particularly, in step 109, the resultant image, to which an equal mean value is applied, is stored, and then the procedure is finished.
Methods which are basically enhancements of the conventional Auto White Balance algorithm and are now widely used in an image signal processors (ISPs) include: a Fuzzy Rule method (FRM) of partitioning one image into a plurality of regions, comparing the mean values of the respective regions with each other, and determining a weight value for white balance; a method of detecting an achromatic color and finding out a weight value for white balance based on the detected image; and a method of detecting an achromatic color by selecting, as achromatic colors, pixels where a brightness value is equal to or greater than a predetermined threshold value, and also an absolute value of a difference between R and G values and an absolute value of a difference between B and G values are equal to or less than a predetermined threshold value.
However, the above technologies have many problems. For example, the FRM has a problem in that the result is changed depending on the sizes of partitioned regions and the determined weight value, and the method using detection of an achromatic color has a problem in that the result is changed according to achromatic color detection methods. Even when various colors are not included in an image, as well as when an image is constituted by only one color or a few colors, there is still a degree of difficulty in estimating an accurate white point.
Accordingly, the present invention provides an apparatus and method for accurately adjusting a white balance of an image by classifying an image according to the characteristics thereof and estimating an accurate white point through a color temperature estimation.
In accordance with an exemplary aspect of the present invention, there is provided a method for adjusting a white balance in a digital imaging device, the method including the steps of: analyzing a histogram of an image to which a white balance algorithm is to be applied; classifying the image, to which the white balance algorithm is to be applied, according to color distribution determination criteria; and applying the white balance algorithm to the image depending on results of the classification based on color distributions. The white balance algorithm is applied differently (i.e. customized) to different images depending on the color distributions.
In accordance with another exemplary aspect of the present invention, there is provided an apparatus for adjusting a white balance in a digital imaging device, the apparatus including: an image sensor unit for photographing a subject and creating an original image; and an image processing unit for finding an achromatic color region through estimation of a color temperature of the original image, for extracting a white point of the achromatic color region, and for adjusting a white balance of the original image.
The above and other exemplary aspects, features and advantages of the present invention will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:
Hereinafter, an exemplary embodiment of the present invention will be described with reference to the accompanying drawings. In the below description, many particular items such as a detailed component device are shown, but these are given only for providing the general understanding of the present invention. It will be understood by those skilled in the art that various changes in form and detail may be made within the scope of the present invention.
As described in the “Description of the Related Art,” the FRM has a problem in that the result changes depending on the sizes of partitioned regions and the determined weight value, and the method using detection of an achromatic color has a problem in that the result is changed according to achromatic color detection methods. Also, even when there are no various colors included in an image, as well as when an image is constituted by only one color or a few colors, it is difficult to estimate an accurate white point. Therefore, in order to solve the above-mentioned problems, the present invention proposes a new method for achieving an accurate white balance of an image in such a manner as to classify the image according to the characteristic thereof, to extract an achromatic color region through a color temperature estimation, and to estimate an accurate white point. Hereinafter, the present invention will be described in detail with reference to a flowchart and a block diagram which illustrate the configuration of an apparatus according to an exemplary embodiment of the present invention.
The entire operation of a white balance algorithm according to the present invention is constituted roughly by three parts.
First, an input image is classified into an image having a distribution of colors higher than a preset threshold value, and an image having a distribution of colors lower than the preset threshold value. Next, the image having a distribution of colors lower than the preset threshold value is once more classified into a single-color image and a non-single-color image. With respect to each of the image having a distribution of colors higher than the preset threshold value and the non-single-color image, among the images classified into three types, an achromatic color region is detected, and the white balance algorithm is applied to the corresponding image by using the detected achromatic color region. In contrast, with respect to the single-color image, the white balance algorithm is not applied.
When the image sensor unit 21 photographs a subject and creates an original image, the hue detection unit 201 of the image-processing unit 23 determines color distribution values by identifying a histogram distribution characteristic of the image. The mean value calculation unit 203 receives the determined color distribution values, and calculates the mean value of the determined color distribution values. The color temperature estimation unit 205 estimates a color temperature by using the mean value obtained by the mean value calculation unit 203, thereby detecting an achromatic color region. The white balance application unit 207 applies a white balance to the original image by using the estimated color temperature and the achromatic color region. The image, to which the white balance has been applied, is stored in the memory unit 25, or is displayed through the display unit 27 according to a user's adjustment. A procedure of applying the white balance algorithm will now be described with reference to the configuration.
Referring now to
In step 303, it is determined whether the color distribution is higher than a threshold value, e.g. the image corresponds to an image having a distribution of various colors. When an absolute value of a difference between a difference value in the G channel and a difference value in the R channel, and an absolute value of a difference between a difference value in the G channel and a difference value in the B channel are equal to or greater than preset threshold values, respectively, the image is determined not to be an image having a distribution of various colors. This is expressed as the following equation.
|dR−dG|<th1R
|dB−dG|<th1B (1)
In contrast, when an absolute value of a difference between a difference value in the G channel and a difference value in the R channel, and an absolute value of a difference between a difference value in the G channel and a difference value in the B channel are less than the preset threshold values, respectively, the image is determined to be an image having a distribution of various colors, and in this case, it is determined that the mean values of histograms of channels are similar to each other. When it is assumed that the mean values of the RGB channels are uR, uG, and uB, respectively, similarity can be measured by the following equation.
|uR−uG|<th2R
|uB−uG|<th2B (2)
In equations 1 and 2, the threshold values “th1R,” “th1B,” “th2R,” and “th2B” are determined according to images through simulations. That is, when both conditions of equations 1 and 2 are satisfied, it is determined that histogram distributions according to channels are similar to each other, thereby determining the image to have a distribution of various colors.
When it is determined in step 303 that the image has a distribution of various colors by application of equations 1 and 2, step 305 is performed. In contrast, when it is determined that the image has a distribution of a small number of colors (or possible a single color), rather than a distribution of various colors, step 307 is performed. First, a procedure of adjusting a white balance with respect to an image having a distribution of various colors will be described.
In step 305, with respect to the image having a distribution of various colors, color temperatures are estimated, for example, by using the Robertson method. The estimation method will now be described with reference to the accompanying drawings which illustrates a color temperature distribution.
In addition, each line perpendicular to the Planckian Locus in
First, according to a procedure of conversion into the x-y domain, a value representing the characteristics of an image is first extracted, and the value is determined to be the mean value of the entire image for each RGB channel, and a conversion into the x-y domain is performed. The mean values of the respective RGB channels of an image, to which a white balance is to be applied, may be obtained by the following equation.
Equation 3 shows a method of obtaining the mean values of the respective RGB channels on the assumption that an image, to which a white balance is to be applied, has a size of “N×M.”
A procedure for conversion into the x-y domain through use of the mean values of the respective channels, obtained by equation 3, will now be described with reference to the following equation.
Equation 4 shows a method for performing a conversion into an XYZ domain through use of the mean values of the respective channels, obtained by equation 3, and then performing a conversion into an x-y domain by normalizing the XYZ.
Still referring to
In equation 5, Tj and Tj+1 are values given by a preset table, as shown in
θ1/θ2=sin θ1/sin θ2=dj/dj+1 (6)
In equation 6, “dj” represents a distance between a line representing a jth color temperature and a point (xj, yj) in which the characteristics of an image are reflected, and “dj+1” represents a distance between a line representing a (j+1)th color temperature and a point (xj+1, yj+1) in which the characteristics of an image are reflected. A distance between a point and a line can be obtained by the following equation.
Accordingly, using a distance between a point and a line, the equation for obtaining the desired color temperature can be approximated to the following equation.
By use of equation 8, the desired color temperature can be estimated from “x” and “y” obtained by equation 4.
Thereafter, referring back to
In equation 9, “S1” and “S2” are defined by the following equation.
S
1={(k,l)|xm−α<x(k,l)<xm+α and ym−α<y(k,l)<ym+α, 0≦m≦31}
S
2={(k,l)|estimated achromatic color} (10)
In equation 10, (xm, ym) represents an intersection point between the Planckian Locus and a line according to a color temperature, and “α” is defined as a constant value between 0 to 0.5.
Next, when the procedure has proceeded from step 303 to step 307, it is determined whether the image not having a distribution of various colors corresponds to a single-color image, and a white balance is adjusted according to a result of the determination, a method for which will now be described.
First, when it is determined in step 307 that the image is not a single-color image, but an image having a distribution of minority colors, it is impossible to identify an exact color temperature by the white balance adjustment method for an image having a distribution of a great number of colors. This is because a mean value inclined to a specific color is inevitably obtained when the mean value of each channel is calculated with respect to the entire image having a distribution of minority colors. Therefore, when it is determined that an image has a distribution of minority colors, a new method described below should be applied with respect to the image. Thus, when it is determined in step 307 that the image does not correspond to a single-color image, but to an image having a distribution of minority colors, values belonging to an achromatic color region based on color temperatures are used to adjust a white balance, which enable a color temperature to be measured, without inclining to a specific color. To this end, in step 309, the entire image is converted into the x-y domain, and then only pixel values included in achromatic color regions based on the color temperatures specified in a color temperature table, which is based on the Robertson method, are extracted.
Thereafter, distinguishing from the case of an image having a distribution of a great number of colors, for which the mean values of RGB in the entire image are used as representative values, in the present case the mean values of RGB of pixels having color temperatures included in achromatic color regions are used as representative values for the image having a distribution of minority colors. That is, when it is assumed in step 311 that “Rs” are values of xy coordinates on the Planckian Locus, corresponding to 31 color temperature values pre-specified in a color temperature table based on the Robertson method, only points belonging to “S1,” are extracted by the following equation and are used to obtain a color temperature in step 313.
In equation 11, “S1” is defined by the following equation.
S
1={(k,l)|xm−α<x(k,l)<xm+α and ym−α<y(k,l)<ym+α, 0≦m≦31 } (12)
In equation 12, (xm, ym) represents 31 achromatic color points based on color temperatures obtained by the Robertson method in step 315. “S1” represents an achromatic color region having a predetermined range according to “α” in the x-y domain. The value of “α” is defined as a constant between 0 and 0.5, as in the case for an image having a distribution of various colors. An achromatic color estimation according to the estimated color temperature is performed based on a scheme of
Meanwhile, when it is determined in step 307 that the image is constituted by a single color, it is impossible to identify an achromatic color. In this case, if the white balance algorithm is unreasonably applied, estimation of an exact color temperature fails due to insufficient information, so that the image is changed into an undesired color as a result of the application of the white balance algorithm. Therefore, when the image corresponds to a single-color image, where a color distribution of pixels included in the achromatic color region is equal to or less than a predetermined threshold value, step 319 is performed. In step 319, the white balance algorithm is not applied, and the input image is output as it is.
In step 317, the white balance algorithm is applied differently to an image having a distribution of a number of colors considered to be large, and an image having a distribution of minority colors. First, commonly, the RGB mean values of an achromatic color region are obtained by the following equation.
In equation 13, “Rsum,” “Gsum,” and “Bsum” are obtained by equation 9 in the case of an image having a distribution of a great number of colors, i.e., an image whose color distribution is higher than a present threshold value and are obtained by equation 11 in the case of an image having a distribution of minority colors, i.e., an image whose color distribution is lower than a present threshold value.
“NAp” represents the number of pixels belonging to both “S1” and “S2” in equation 10 in the case of an image having a distribution of a great number of colors, and represents the total number of pixels belonging to 31 predetermined achromatic color regions in the case of an image having a distribution of minority colors.
RGB channel values, to which a white balance algorithm based on equation 13 is applied, can be obtained by the following equation.
An achromatic color region is identified through a color temperature estimation based on equation 14, and then a white point is derived. Accordingly, a white point is accurately estimated, so that the while balance of a corresponding image is accurately adjusted.
The apparatus and method for adjusting a white balance in a digital imaging device according to an exemplary embodiment of the present invention is achieved as shown in the examples described above. While the present invention has been shown and described with reference to certain exemplary embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Accordingly, the scope of the invention is not to be limited by the above embodiments but by the claims and the equivalents thereof.
As described above, according to the present invention, it is possible to achieve an accurate white balance of an image signal input from a camera sensor, thereby improving the quality of the image.
Number | Date | Country | Kind |
---|---|---|---|
10-2008-0012777 | Feb 2008 | KR | national |