Before this I took this course I was so naive about some things and included in those things is the concept of white balance.
I hear the term before but I never even bother to take some time to Google any information about it. But after performing this activity, I truly appreciated the white balancing algorithms as they transform images taken with different light sources to maintain their color signatures.
In this activity, we explored two common method being utilized in white balancing namely, White Patch Algorithm and the Gray World Algorithm.
We first take images of a single scene with a white material in it using different white balancing modes in a digital camera.
Given these images, we sampled an image with the least appropriate white balance setting for the lighting condition during the image was taken. From this data, we can start implementing the two algorithms mentioned above.
First, we implemented the White Patch Algorithm. A requirement of the White Patch Algorithm is that a white patch must be present in the image to be a reference or the normalizing value. Thus, we chose from the image a pixel with white value and inputted it to the algorithm. Shown in Fig. 1 is the image captured under a sunlight lighting with a white balance mode of "Incandescent" set in the digital camera.
Figure 1: Image with inappropriate white balance setting (Incandescent) used in the lighting condition (Sunlight). |
The White Patch Algorithm simply normalizes the entire image with the chosen white patch from the image itself. After the normalization, we formed the image array and reconstructed the image. The result is shown in Fig. 2 - White Patch Algorithm applied to the original image (Fig. 1).
Figure 2: Resulting image after the White Patch Algorithm has been applied to the original image. |
It is quite noticeable that a significant change in the image can be observed. The white bond paper lost the "bluish stain" after the algorithm was applied and it appears to be very pure white. The other colors can be seen to have improved and look more like in the real world.
The next algorithm that will be performed is the Gray World Algorithm. In this method, the mean of each color channel is the variable used to normalize each of the values in the respective channels. We performed this technique to the original image and the result is shown in Fig. 3,
Figure 3: Resulting image after the Gray World algorithm was applied to the original image. |
In Fig. 3, the resulting image appear to be have a higher intensity but the white bond paper looks so pure white. On the other hand, the other colored objects seem to be flooded by the white contrast.
The next aspect we looked at is the accuracy and efficiency of the two algorithms. To do this, we took an image of collection of object sharing the same shade of hue with no white in the background. The image used is shown in Fig. 4,
Figure 4: Image with inappropriate white balance (Incandescent) with objects sharing the same shade of hue under a fluorescent lighting. |
We performed both algorithms in this image and the results are shown in Fig. 5,
Figure 5: Left) White Patch Algorithm, Right) Gray World Algorithm applied to the original image. |
We have observed that the White Patch Algorithm is better used when the colors in the spectrum is not well represented in the image. Even though the image appeared grainy after the application of the White Patch Algorithm it still appeared more crisp relative to the result after the gray World Algorithm has been applied to the images.
The possible reason why the White Patch Algorithm is suited in the case when only a small portion of the color spectrum is represented in the image is that for the Gray World Algorithm, the mean of the entire color channel is being used in the normalization, thus, since other colors are not represented the result of the normalization will probably not give the true white balance for the image.
In the succeeding figure, the results of the implementation of both algorithms are shown for various white balance setting used in capturing the scene. In the first column of the figures below show the images after the White Patch Algorithm has been implemented to the original images which are those in the middle column, while the last column corresponds to the result after the Gray World Algorithm has been applied.
Figure 6: Left) White Patch Algorithm applied to the original image; Middle) Original image under "Cloudy" white balance mode; Right) Gray World Algorithm applied to the original image. |
Figure 7: Left) White Patch Algorithm applied to the original image; Middle) Original image under "Fluorescent 1 " white balance mode; Right) Gray World Algorithm applied to the original image. |
Figure 8: Left) White Patch Algorithm applied to the original image; Middle) Original image under "Fluorescent 2" white balance mode; Right) Gray World Algorithm applied to the original image. |
Figure 9: Left) White Patch Algorithm applied to the original image; Middle) Original image under "Fluorescent 3" white balance mode; Right) Gray World Algorithm applied to the original image. |
No comments:
Post a Comment