The technology described in this patent document relates generally to data processing and more particularly to digital image processing.
Human eyes typically have a “color constancy” ability to cope with different lighting conditions. For example, when a white object is illuminated under different light sources, a person can usually perceive the object as white despite the different light sources. However, digital cameras often do not have such a “color constancy” ability. When an image is captured by a digital camera, a light source used for illumination can often cause a white object in the captured image to appear “non-white.” For example, a tungsten light bulb used for illumination can cause a white object to appear yellow or orange in the captured image. In another example, a white object may appear blue or even green in a captured image under a fluorescent bulb. In order to make a white object appear white in a digital image, pixel values of the image can be adjusted to reduce the color distortion caused by the light source of the image. This process of changing the pixel values of the captured image to compensate for the effects of the light source is often referred to as performing white balancing of the image.
In accordance with the teachings described herein, systems and methods are provided for performing white balancing of an image. An image including one or more pixels is received, wherein a pixel corresponds to an input color value. A light source of the image is determined based at least in part on the input color values of the pixels, wherein the light source is used for illumination when the image is captured. New color values of the pixels are generated to reduce color distortion caused by the light source of the image.
In one embodiment, a processor-implemented system for performing white balancing of an image includes, one or more data processors, and a computer-readable storage medium encoded with instructions for commanding the data processors to execute operations. The operations include, (a) receiving an image including one or more pixels, wherein a pixel corresponds to an input color value, (b) determining a light source of the image based at least in part on the input color values of the pixels, wherein the light source is used for illumination when the image is captured, and (c) generating new color values of the pixels to reduce color distortion caused by the light source of the image.
In another embodiment, a digital image acquisition device includes a storage unit, a data processing system, and a white-balancing unit. The storage unit is configured to receive an image including one or more pixels, wherein a pixel corresponds to an input color value. The data processing system is configured to determine a light source of the image based at least in part on the input color values of the pixels, wherein the light source is used for illumination when the image is captured. The white-balancing unit is configured to generate new color values of the pixels to reduce color distortion caused by the light source of the image.
Specifically, the color-temperature-indicator calculator 102 receives the image 108 which includes a number of pixels, and calculates values of the color-temperature indicator 110 based on color values (e.g., R, G, B components) of the pixels in the image 108. The light-source component 104 determines the light source of the image, e.g., by mapping to known light sources using the calculated values of the color-temperature-indicator 110.
The color-temperature indicator used by the color-temperature-indicator calculator 102 may be pre-selected and can be used to detect different light sources.
For example, the first eighteen patches in the color chart (e.g., from 1 to 18) have different colors, and the last six patches (e.g., from 19 to 24) have various gray levels. The five light sources include the horizon light, the incandescent lamp, the fluorescent light, the carbon arc, and the mid daylight, of which the color temperature values are shown in Table 1.
The variation of the color-temperature indicator with the color temperatures is clearly shown in
In addition, another color-temperature indicator R/(B+e) is suitable for detecting light sources, where e is an adjustable parameter. As an example, when e is set to be 12, a computer code for detecting a light source of an image using the color-temperature indicator R/(B+e) is shown below:
In some embodiments, other color-temperature indicators may be pre-selected for use in the example system 100 as shown in
With reference back to
For example, a gray patch in the color chart (e.g., patch 19) has different color values under different light sources as shown in Table 2.
Ideally, the red component (R), the green component (G) and the blue component (B) of a gray pixel should be equal. However, under a particular light source, the red component, the green component and the blue component shown in Table 2 are not equal. White-balancing factors for the gray patch can be determined as follows:
If the light source is determined to be the horizontal light, then the color values of the gray patch are R=253, G=220, B=121 as shown in Table 2. The white-balancing factors can be calculated: Kf=0.7826, Kg=0.9, Kb=1.6364. The new color values of the gray patch after white balancing can be determined as: R’=Kf×xR=198, G’=Kg×G=198, B’=Kb×B=198. Thus, the balanced color values indicate a gray pixel.
Table 3 below lists color values (R, G, B) of different gray patches in the color chart: under different color sources, as well as the corresponding gray levels (Y). For example. Y=0.299×R+0.587×G+0.114×B.
Therefore, for pixels with different gray levels, different sets of white balance factors are used for white balancing. If a pixel has a gray level other than those listed in Table 3 or the light source of the image is different from those listed in Table 3, interpolation or extrapolation may be used to derive the corresponding color values and the corresponding white-balancing factors. Further, color correction may be performed on the image after the white-balancing.
This written description uses examples to disclose the invention, include the best mode, and also to enable a person skilled in the art to make and use the invention. The patentable scope of the invention may include other examples that occur to those skilled in the art.
For example, the systems and methods described herein may be implemented on many different types of processing systems by program code comprising program instructions that are executable by the system processing subsystem. Other implementations may also be used, however, such as firmware or appropriately designed hardware configured to carry out the methods and systems described herein. In another example, the systems and methods described herein may he implemented in an independent processing engine, as a co-processor, or as a hardware accelerator. In yet another example, the systems and methods described herein may be provided on many different types of computer-readable media including computer storage mechanisms (e.g., CD-ROM, diskette, RAM, flash memory, computer's hard drive, etc.) that contain instructions e.g., software) for use in execution by a processor to perform the methods’ operations and implement the systems described herein.
This disclosure claims priority to and benefit from U.S. Provisional Patent Application No. 61/674,719, filed on Jul. 23, 2012, and U.S. Provisional Patent Application No. 61/714,566, filed on Oct. 16, 2012, the entirety of which are incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
5581298 | Sasaki et al. | Dec 1996 | A |
20020106206 | Takeshita | Aug 2002 | A1 |
Number | Date | Country | |
---|---|---|---|
61674719 | Jul 2012 | US | |
61714566 | Oct 2012 | US |