Overview

I evaluated the Olympus D-220L digital camera's color-balancing capabilities with respect to two possible illuminant-estimation algorithms. The first algorithm is based on the gray world assumption, which states that the average of all the surfaces in the image is gray. The second algorithm assumes that the brightess image region is the result of the illuminant reflecting off a perfect uniform reflector. The color of that region therefore gives the color of the illuminant.

Scattered throughout this report are numerous hyperlinks to Matlab code I have written for this project. I highly recommend reading through the detailed comments in my code to gain a more complete understanding of our methodologies.

 

Gray World Assumption

Statistically, the gray world assumption makes perfect sense: in an image with similar dynamic ranges for each of its color components, which is generally true of the pictures we take, each spectral sample has an equal probability of being above or below a certain fixed value. By summing across hundreds of thousands of samples, we would expect the average to converge to that fixed value.

Here is one way in which a camera can exploit this observation to color-balance an image. First, the camera calculates average values for the red, green and blue components from raw image data. By the gray world assumption, these three components should have the same value. However, if the illuminant does not have a constant spd, these average values will deviate from one another in a way that is characteristic of the color appearance of the illuminant. For instance, data obtained under tungsten illuminant will have higher red and green averages than blue averages.

To force the gray world assumption to hold, the camera can scale each of the color channels independently to equalize the RGB averages. The camera begins by picking an overall value for the averages to converge to. One convenient value is simply the average of the three component averages. Multiplying each color channel by (overall average / component average) will yield an image for which the gray world assumption is true.

Perfect Reflector Assumption

This algorithm focuses only on the specularities or glossy surfaces in the image, and does not take into account the overall appearance. In fact, this may be a better approach for images where there is too little color variation for the gray world assumption to hold. The perfect reflector assumption uses the fact that the brightess regions of an image often belong to glossy surfaces with reflectance functions that are roughly constant over a broad range of wavelengths. As such, these specularities reflect the actual color of the light source. Thus, if we wish to reconstruct the color appearance of the subject under white light, we should scale the image's RGB components to render the specularities white. The scale factor for each color channel is just 255 / specular value.

Although exaggerated, the above image (not actual test data)
demonstrates that specularities do provide plenty of illuminant information.

back