This invention relates to a white balance correction apparatus and method. More particularly, the invention relates to a white balance correction apparatus and method used in a device such as a digital camera or digital video camera.
The digital signal that is output from the A/D converter circuit 3 has its white gain adjusted by a white balance circuit 4, whence the resulting signal is sent to a luminance notch circuit 12. The luminance notch circuit 12 uses a vertical low-pass filter (VLPF) to execute processing for reducing signal gain of a frequency in the vicinity of the Nyquist frequency in the vertical direction. Gain reduction processing by a horizontal low-pass filter (HLPF) is executed similarly in the horizontal direction. Such a filter shall be referred to as a “luminance notch filter” below. Next, a horizontal band-pass filter (HBPF) circuit 13 and vertical band-pass filter (VBPF) circuit 16 raise the frequency, which is slightly lower than the Nyquist frequency weakened by the notch filters.
Amplitude is adjusted subsequently by PP (aperture peak) gain circuits 14 and 17 in both the horizontal and vertical directions, and then low amplitude is cut, thereby eliminating noise, by base clipping (BC) circuits 15 and 18. The horizontal and vertical components are subsequently added by an adder 19, main gain is applied by an APC (Aperture Control) main gain circuit 20, and the resultant signal is added to a baseband signal by an adder 21. A gamma conversion circuit 22 then performs a gamma conversion and a luminance correction (YCOMP) circuit 23 executes a luminance-signal level correction based upon color.
Next, as an example of color signal processing, a color interpolation circuit 5 executes an interpolation with regard to all pixels in such a manner that all color pixel values will be present, and a color conversion matrix (MTX) circuit 6 converts each of the color signals to a luminance signal (Y) and color difference signals (Cr, Cb). Color-difference gain of low- and high-luminance regions is then suppressed by a chroma suppression (CSUP) circuit 7, and band is limited by a chroma low-pass filter (CLPF) circuit 8. The band-limited chroma signal is converted to an RGB signal and is simultaneously subjected to a gamma conversion by a gamma conversion circuit 9. The RGB signal resulting from the gamma conversion is again converted to Y, Cr, Cb signals, gain is adjusted again by a chroma gain knee (CGain Knee) circuit 10, and a linear clip matrix (LCMTX) circuit 11 makes a minor correction of hue and corrects a shift in hue caused by individual differences between image sensing devices.
Processing executed by the white balance circuit 4 in the image sensing apparatus of
Cx=(R−B)/Y
Cy=(R+B−2G)/Y
Y=(R+G+B)/2 (1)
The color evaluation values Cx, Cy of each block calculated in accordance with Equations (1) are compared with a previously set white detection region (described later). If the evaluation values fall within the white detection region, it is assumed that the block is white and then the summation values (SumR, SumG, SumB) of respective ones of the color pixels of the blocks assumed to be white are calculated. White balance gains kWB_R, kWB_G, kWB_B for each of the colors RGB are then calculated from the summation values using the following equations:
kWB—R=1.0/SumR
kWB—G=1.0/SumG
kWB—B=1.0/SumB (2)
The white balance circuit 4 performs the white balance correction using the white balance gains thus obtained.
The conventional white balance detection apparatus, however, has certain drawbacks. For example, consider a case where a close-up of the human face is taken in the presence of a light source such as sunlight having a high color temperature. Though the color evaluation values of a white subject in the presence of sunlight are distributed as indicated by area 103 in
Further, the color evaluation values are distributed as indicated in area 106 in
The present invention has been made in consideration of the above situation and has as its object to reduce erroneous decisions regarding white evaluation, thereby performing a better white balance correction.
According to the present invention, the foregoing object is attained by providing a white balance correction apparatus comprising; a dividing unit adapted to divide an image into a plurality of areas; a white evaluation unit adapted to determine whether image data within every divided area is indicative of the color white according to the position of each divided area in the image; and a white balance correction unit adapted to perform a white balance correction based upon image data determined to be indicative of the color white.
According to the present invention, the foregoing object is also attained by providing a white balance correction method comprising; dividing an image into a plurality of areas; determining whether image data within every divided area is indicative of the color white according to the position of each divided area in the image; and performing a white balance correction based upon image data determined to be indicative of the color white.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate an embodiment of the invention and, together with the description, serve to explain the principles of the invention.
Preferred embodiments of the present invention will be described in detail in accordance with the accompanying drawings.
As shown in
The reference white detection region stored in the white detection region storage unit 32 will now be described. The description will relate to a case where a primary-color filter is used as the image sensing device 1.
In
Conventionally, the evaluation block dividing unit 31 divides the output signal of the image sensing device 1 into a plurality of evaluation blocks of the kind shown in
In
The white evaluation unit 35 subjects the evaluation blocks to a white evaluation and the WB coefficient calculation unit 36 calculates the WB coefficients (white balance gains) from the summed values of the pixel values in evaluation blocks determined to be white and stores these coefficients in the WB coefficient storage unit 37. The WB correction unit 38 subjects the input image to a WB correction using the coefficients stored in the WB coefficient storage unit 37.
White evaluation processing will now be described with reference to
First, at step S11 in
Next, at step S14, the white evaluation unit 35 determines whether each evaluation block is in region (1) or region (2). If it is in region (1) (“YES” at step S14), control proceeds to step S15, at which the color evaluation values of the evaluation block are compared with the white detection region 203, which is shown in
If the evaluation block is in region (2) (“NO” at step S14), control proceeds to step S16, at which the color evaluation values of the evaluation block are compared with the white detection region 204, which is shown in
If the color evaluation values of an evaluation block are found to fall within the white detection region 203 or 204 at either step S15 or S16, then control proceeds to step S17, at which the white evaluation unit 35 decides that this evaluation block is white. If the color evaluation values of an evaluation block are found not to fall within the white detection region 203 or 204, then control proceeds to step S18, at which the white evaluation unit 35 decides that this evaluation block is not white.
An evaluation block thus determined to be white has its pixel values summed in order to calculate the white gains (WB coefficients), as described above.
Whether the decision as to whether an evaluation block is white has been rendered with regard to all evaluation blocks is determined at step S19. Steps S14 to S18 are repeated until all of the evaluation blocks have been evaluated.
Experiments have shown that excellent results can be obtained if the white detection limit Ll2 on the side of low color temperature is fixed at about 5000 K. However, it goes without saying that the present invention is not limited to 5000 K and that this can be changed as appropriate.
In accordance with the first embodiment, as described above, erroneous decisions regarding white evaluation can be reduced by using a white detection region that differs depending upon position on the screen. As a result, it is possible to perform a better white balance correction.
Further, by enlarging the area of the central region (2), as shown in
However, though it may be considered that there is a high likelihood that complexion will be present at the central part of the screen if the mode is the portrait mode, it may also be considered that there are many instances where complexion is not present at the central part of the screen if the mode is the automatic mode. If the above-described setting of the screen and setting of white limits is made in a case where completion is not present at the central part of the screen, the result of color-temperature detection at the center of the screen will not fall below the white detection limit Ll2 (e.g., 5000 K) on the side of low color temperature. A problem that arises as a consequence is that the result of color temperature based upon an image captured under, e.g., the A light source will become higher than the actual light-source color temperature. Accordingly, a white balance correction of higher precision can be achieved by performing the determination regarding the absence or presence of complexion before the operation indicated at step S12 in
Evaluation blocks in which image data is determined to be white (these blocks shall be referred to as “white evaluation blocks” below) are detected at step S21 using the same white detection region (a region delimited by the white detection limits or a region in which the color-temperature region of complexion is contained in a white detection region that is not limited; e.g., either the white detection region 201 or 203) with regard to all evaluation blocks in the central portion of the screen [region (2) in
Next, CtAround and CtCenter are compared at step S24. If the color temperature CtCenter obtained from the central portion of the screen is less than the color temperature CtAround obtained from the peripheral portion of the screen, then it is judged at step S25 that there is a high likelihood that complexion is present in the central portion of the screen. In other words, if
CtCenter<CtAround
holds, then the central portion of the screen is judged to contain complexion and the light-source color temperature is calculated at step S26 by performing the white evaluation in the automatic mode shown in
On the other hand, if the color temperature CtCenter obtained from the central portion of the screen is substantially equal to or greater than the color temperature CtAround obtained from the peripheral portion of the screen, it is judged at step S27 that there is a high likelihood that complexion is not present at the central portion of the screen. In other words, if
CtCenter≧CtAround
holds, then it is judged that complexion is not present, all evaluation blocks are compared with a common white detection region (step S28), white evaluation blocks are detected and the light-source color temperature obtained is adopted.
Adding on the above processing makes it possible to reduce even further erroneous decisions regarding white evaluation and makes it possible to perform a better white balance correction.
If the manual mode is found to be in effect at the mode discrimination step S11, then, in a manner similar to that where absence of complexion is determined, all evaluation blocks are compared with a common white detection region, white evaluation blocks are detected and the light-source color temperature obtained from image data in the white evaluation blocks is adopted.
(First Modification)
Color evaluation values of an evaluation block in an image region in which the sky appears close to thin clouds or the horizon have a distribution substantially the same as that of color evaluation values of white points in the shade, as mentioned earlier. Consequently, an evaluation block in a portion of an image that is the sky is judged erroneously to be white. In other words, the sky is judged erroneously to be white, which has a high color temperature. Accordingly, white evaluation is carried out using different white detection regions in the upper and lower parts of the screen, as shown in
In the first modification, as shown in
Experiments have shown that excellent results can be obtained if the white detection limit Lh4 is fixed at about 5500 K. However, it goes without saying that the present invention is not limited to 5500 K and that this can be changed as appropriate.
In accordance with the first modification, as described above, erroneous decisions regarding white evaluation can be reduced by using a white detection region that differs depending upon position on the screen. As a result, it is possible to perform a better white balance correction.
Further, by enlarging the area of the upper region (2), as shown in
In the first modification, brightness Bv of a subject may be detected from the captured image data and white detection patterns of the kind shown in
(Second Modification)
white detection limit Lh5 on the side of high color temperature: 5500 K;
white detection limit Ll5 on the side of low color temperature: brightness variable (
the following settings are made with respect to the region (2) in
white detection limit Lh6 on the side of high color temperature: brightness variable;
white detection limit Ll6 on the side of low color temperature: brightness variable (
the following settings are made with respect to the region (3) in
white detection limit Lh7 on the side of high color temperature: 5500 K;
white detection limit Ll7 on the side of low color temperature: 5000 K (
the following settings are made with respect to the region (4) in
white detection limit Lh8 on the side of high color temperature: brightness variable;
white detection limit Ll8 on the side of low color temperature: 5000 K (
It should be noted that the specific values indicated as the white detection limits Lh5, Lh7, Ll7 Ll8 are examples only. The present invention is not limited to these values and the values can be changes as appropriate.
In accordance with the second modification, as described above, use is made of patterns in which the area of the screen is more finely divided and white evaluation is performed using white detection regions that differ depending upon position on the screen. Accordingly, a white balance correction of even higher precision can be achieved.
It should be noted that the pattern used can be changed depending upon the image sensing mode in a manner similar to that of the first embodiment.
The characterizing feature of the second embodiment is that the vertical/horizontal orientation determination unit 40 discriminates horizontal and vertical orientations (rotation clockwise by 90° and rotation counter-clockwise by 90°) based upon the output of a gravity sensor (not shown) and makes it possible to change the setting of white detection limits depending upon the state of photography.
The evaluation blocks in the regions (1) to (4) of
In accordance with the second embodiment, as described above, white evaluation of each evaluation block can be performed appropriately irrespective of camera orientation (horizontal or vertical) at the time of image sensing.
It should be noted that the pattern settings shown in
In the above embodiments, a case in which the white detection region is limited by the white detection region varying unit 33 has been described. However, it may be so arranged that a plurality of white detection regions are stored in advance and any of the stored white detection regions is used in dependence upon the position of the evaluation block.
Software and hardware implementations of the above embodiments can be substituted as appropriate.
Further, the above embodiments or the technical elements thereof may be combined as necessary.
Furthermore, even if all or part of the structure of the claims or of the embodiments forms a single apparatus, or even if a connection is made to an image sensing apparatus such as a digital camera or video camera or to another apparatus such as an image processing apparatus that processes signals obtained from an image sensing apparatus, the present invention may serve as an element that constructs such apparatus.
Further, the object of the present invention can also be achieved by providing a storage medium storing program codes for performing the aforesaid processes to a computer system or apparatus (e.g., a personal computer), reading the program codes, by a CPU or MPU of the computer system or apparatus, from the storage medium, then executing the program.
In this case, the program codes read from the storage medium realize the functions according to the embodiments, and the storage medium storing the program codes constitutes the invention.
Further, the storage medium, such as a floppy disk, a hard disk, an optical disk, a magneto-optical disk, CD-ROM, CD-R, a magnetic tape, a non-volatile type memory card, and ROM, and computer network, such as LAN (local area network) and WAN (wide area network), can be used for providing the program codes.
Furthermore, besides aforesaid functions according to the above embodiments are realized by executing the program codes which are read by a computer, the present invention includes a case where an OS (operating system) or the like working on the computer performs a part or entire processes in accordance with designations of the program codes and realizes functions according to the above embodiments.
Furthermore, the present invention also includes a case where, after the program codes read from the storage medium are written in a function expansion card which is inserted into the computer or in a memory provided in a function expansion unit which is connected to the computer, CPU or the like contained in the function expansion card or unit performs a part or entire process in accordance with designations of the program codes and realizes functions of the above embodiments.
In a case where the present invention is applied to the aforesaid storage medium, the storage medium stores program codes corresponding to the flowcharts shown in
The present invention is not limited to the above embodiments and various changes and modifications can be made within the spirit and scope of the present invention. Therefore to apprise the public of the scope of the present invention, the following claims are made.
Number | Date | Country | Kind |
---|---|---|---|
2002-043326 | Feb 2002 | JP | national |
This application is a divisional of U.S. application Ser. No. 10/368,956, filed Feb. 19, 2003, entitled, “White Balance Correction” and of which the entire contents is incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | 10368956 | Feb 2003 | US |
Child | 11964345 | Dec 2007 | US |