Thursday, August 6, 2009

Color Image Processing


In image processing, the attainment of a well-adjusted combination of colors is very important. The quality of the ensemble of colors that are imaged from the detector depends on generation of the RGB colors which is a product of the spectral power distribution of the illuminant S(λ), reflectance of the surface ρ(λ) and the spectral sensitivity of the camera to red ηR, green ηG, and blue ηB color. Mathematically, this is expressed as:


where

The constant K is the white balancing constant. By normalizing this constant, the pixel values of the image are said to be “white balanced” to the light source [1].

White balance (WB) is the process of removing unrealistic color casts, so that the color of an object is retained when it is photographed. On of the factors that affect white balancing is the "color temperature" of a light source, which refers to the relative warmth or coolness of white light [2]. Nowadays, digital cameras have a setting called “auto white balance (AWB)”. This function of the camera allows it to adjust its white balance depending on the temperature of the illuminant. However, the AWB does not always give the type of image that you want to have. AWB does not provide maximum color accuracy and results to a problem when the color of the light is an integral part of the image [3]. This is why there are other white balancing options in cameras, such as incandescent, fluorescent, daylight, and cloudy.

Correct white balance can be obtained using two algorithms, the White Patch Algorithm (WPA) and the Gray World Algorithm (GWA). In WPA, an unbalanced camera image is captured and the RGB of the known white object is used as the divider. On the other hand, GWA assumes that the average color of the world is gray. Thus, by knowing the RGB of a gray object, it remains to be the RGB of the white until a constant factor. The balancing constants are obtained by averaging the red, green and blue values and utilizing them as the balancing constants [1].

For this activity, the two algorithms are applied to correct the white balance of the images taken under incandescent, fluorescent, daylight and cloudy illumination conditions.

The following images below are incorrectly white balanced. The settings of the camera phone are incandescent, fluorescent, daylight and cloudy.

After using WPA and GWA, the following images are obtained.



Figure 2. Processing unbalanced images using White patch and Gray world algorithm.

In general, it is highly observed that the white balance of the original images has been corrected. The intensities of the colors have been adjusted such that higher image quality is obtained. However, from the four different white balance settings, the illumination under a cloudy condition is white balanced in the poorest quality. Although the white mat which appears slightly bluish in the original image has been reconstructed, it is still darker and the true white color is not obtained. This could be attributed to the choice of the “white patch” and the normalizing constant. It is also observed that the reconstructed images using GWA yields darker than the WPA. This maybe enhanced by changing the normalizing constants used.

The next image shows objects with the same hues taken under incandescent setting.


Figure 2. Processing unbalanced image of objects having same hues.

Again, it can be seen that the image is enhanced such that the high intensity of blue light dominates the picture is lessened.

Upon doing the reconstruction of the images using WPA, I had some difficulty in choosing the correct white patch in order yield enhanced images. This affects the total image quality because the white patch is used as the divider of the RGB colors. Based from this, I would say that GWA is better than WPA because using this algorithm, the quality of the reconstructed image depends on the average of the R, G, and B. The values can be modify such that if the quotient of the image layer over the RGB averages is greater than 1, we can set this value to 1 (For attainment of normalized values).

For this activity, I give myself a grade of 10 since all the objectives are met. I would like to thank Jica Monsanto for capturing some of the images while I arrange the object to be photographed and Mr. Combinido for commenting on my code. Thanks guys!



References:

1. Color Image Processing, Applied Physics 186 Handout.

2. http://www.cambridgeincolour.com/tutorials/white-balance.htm

3. http://www.ronbigelow.com/articles/white/white_balance.htm


1 comment: