Have you ever tried fiddling with the settings on your camera? One specific setting that is common to most cameras is the white balance setting. White balance settings lets the user change the white balancing constants suitable for the capturing conditions.
Looking at it in a scientific perspective, image captured by color cameras are defined by the integral product of the spectral power distribution of the incident light source, the surface reflectance of the object, and spectral sensitivity of the camera used.
R,G, and B are the red, green and blue values of a pixel in the image. The K in the equations above are balancing constants.
To further observe what is white balancing, let's take images for different white balance settings in a specific lighting condition.
Figure 1. Images taken under fluorescent lighting in different white balance settings (clockwise from top left: automatic, daylight, tungsten, and fluorescent).
Figure 2. Images taken under natural ambient lighting in different white balance settings (clockwise from top left: automatic, daylight, tungsten, and fluorescent).
Figure 3. Images taken under direct sunlight in different white balance settings (clockwise from top left: automatic, daylight, tungsten, and fluorescent).
We can see that by changing the white balance setting of the camera, the color of the images produced are different from that of the real object. However, we can see that with the automatic white balance setting, it is able to correct the colors of the images produced for any lighting condition.
In this activity, we will simulate how this automation works. There are two of algorithm for automation, the white patch algorithm and the gray world algorithm. The white patch algorithm uses the color layer values of a pixel of a white object in the image for normalization in each color layer, while the gray world algorithm uses the average of each color layer for normalization in color layer.
Figure 4. White patch algorithm results of images taken under room lighting condition in daylight, fluorescent and tungsten white balance.
Figure 5. Gray world algorithm results of images taken under room lighting condition in daylight, fluorescent and tungsten white balance.
Figure 6. White patch algorithm results of images taken under natural ambient lighting condition in daylight, fluorescent and tungsten white balance.
Figure 7. Gray world algorithm results of images taken under natural ambient lighting condition in daylight, fluorescent and tungsten white balance.
Figure 8. White patch algorithm results of images taken under direct sunlight condition in daylight, fluorescent and tungsten white balance.
Figure 9. Gray world algorithm results of images taken under direct sunlight condition in daylight, fluorescent and tungsten white balance.
We can see that after applying the two algorithms on unbalanced images, the colors are corrected. However, saturation occurred ob both images. The saturation was caused by high exposure value setting of the camera.
Now lets try to apply the two algorithms in an image that has one dominant hue.
Figure 10. An image that has red as a dominant hue and has one white object.
Applying the two algorithms to the image in Figure 10.
Figure 11. (left) White patch algorithm and (right) gray world algorithm applied to the image in Figure 10.
We can see that the resulting image of the white patch algorithm is almost the same as the original. On the other hand, the resulting image of the gray world algorithm has saturations. From this, we can say that white patch algorithm is better than the gray world algorithm.
In summary, we have discussed what is this white balance thing in our camera and how does it work. We also found that white patch algorithm is better than the gray world algorithm. I will give myself a grade of 10 for this activity. Even though doing this activity is very tedious, it is fun to play with! =D
Reference:
- Dr. Soriano. Applied Physics 186 activity manual: A12-Color Image Processing. 2010.
- May Ann Tenorio for the pictures!