Wednesday, August 27, 2008

A15 - Color Camera Processing

August 28, 2008


We performed white balancing on images under different white balancing settings. In figure 1, row 1, we see the original images under white balancing settings inside-cloudy, inside-incandescent and auto-white balance, respectively. We see that the colors they contain per point are different and the white of the first two settings do not appear white. We try to process the first two images using Reference White Algorithm (results in second column) and Gray World Algorithm (results in third column). Now their white looks whiter, with the processed image for the inside-cloudy setting closer to the AWB setting. We may say that processed images from the Gray World Algorithm are slightly darker than those from the Reference White Algorithm.Figure 1. Myriad-colored objects processed using Reference White Algorithm and Gray World Algorithm. The white patches used for processing are in the lower-right corner of the collage figure.

Next we, try processing objects with different shades of the same hue. We try this for a high contrast image (with dark and bright background), and low contrast image (bright background only). We now see that Gray World Algorithm results are brighter. And white appears whiter for the high contrast image.Figure 2. Monochromatic Objects Processed. 1st row: raw images; 2nd row: Reference White Algorithm outcomes; 3rd row: Gray World Algorithm results. Right most image: the white patch

Code for performing the Reference White and Gray World Algorithms

//1. Defining the stacksize and calling of image
n = 100000000;
stacksize(n);
M = imread('C:\Documents and Settings\AP186user20\Desktop\act15\i - incandescent.jpg');

//2. Reference White Algo
white = imread('C:\Documents and Settings\AP186user20\Desktop\act15\whitepatch_i-incandescent.jpg');
Rw = mean(white(:,:,1));
Gw = mean(white(:,:,2));
Bw = mean(white(:,:,3));

//3. Gray World Algo
K(:,:,1) = M(:,:,1)/Rw;
K(:,:,2) = M(:,:,2)/Gw;
K(:,:,3) = M(:,:,3)/Bw;
K = K/max(max(max(K)));
imwrite(K,'C:\Documents and Settings\AP186user20\Desktop\act15\ReferenceWhite_i-incandescent.jpg');

SELF-GRADE:
10/10 because I was able to finish the activity on time

CREDITS:
Rica, Aiyin, Beth for helping me acquire images and explaining the algorithms

No comments: