1. Field of the Invention
The present invention relates to an image processing apparatus and a control method therefor, and in particular to a technique to estimate an illuminant color from an image.
2. Description of the Related Art
Conventionally, most digital cameras have an automatic white balance (AWB) control function whereby the white balance is adjusted in accordance with the output from an image sensor without using an external sensor. For example, Japanese Patent Laid-Open No. 5-64219 discloses a method for adjusting the white balance in accordance with the output from an image sensor. This method extracts a color that is considered to be white (achromatic) from an input image and calculates a white balance gain that renders the extracted color white.
Another known method is to use a bicolor light reflection model whereby the object light of an object is separated into specular reflection components and diffuse reflection components.
Furthermore, Japanese Patent No. 4447520 discloses a method for identifying an illuminant color that illuminates an object by calculating a difference between adjacent pixels that vary in brightness. This method is based on a principle that components of the illuminant color are extracted by calculating a difference between a high-luminance first pixel (including both diffuse reflection components that reflect the object color and specular reflection components that reflect the illuminant color) and a pixel that has lower luminance than the first pixel (diffuse reflection components that include only the object color).
More specifically, a difference between the RGB value of the high-luminance first pixel and the RGB value of a second pixel that has lower luminance than the first pixel is calculated. As the resultant difference RGB value has the same vector components as the illuminant color, a white balance gain can be calculated based on the component ratio of the difference RGB value.
When an image does not include any white object or includes many objects that are close to but are not white, the method described in Japanese Patent Laid-Open No. 5-64219 lowers the accuracy of estimation of the illuminant color, that is to say, the accuracy of adjustment of the white balance.
Similarly, the method described in Japanese Patent No. 4447520 lowers the accuracy of adjustment of the white balance for images with a small luminance difference (dynamic range).