Sunday, October 12, 2008

A15: Color Image Processing

In this activity, two popular algorithms will be used for white balancing. The Reference White Algorithm(RWA) and the Gray World Algorithm(GWA). For RWA, we will pick a color in an image as reference for white. Its RGB values will then be used to divide other RGB channels. For GWA, we take the average of each channel and take their averages as balancing constants. 

Using these algorithms, we compare the images after application to different white balance settings of the camera. 

Flourescent


Tungsten


Daylight


Blue objects


Comparing the images from both algorithms, the reference white is much better to use than the gray world algorithm in images where there are many colors. The same goes for images with just different hues.

CODE:

//Reference White

I = imread('image');

imshow(I);

pix = locate(1);

Rw = I(pix(1), pix(2), 1);

Gw = I(pix(1), pix(2), 2);

Bw = I(pix(1), pix(2), 3);


I(:, :, 1) = I(:, :, 1)/Rw;

I(:, :, 2) = I(:, :, 2)/Gw;

I(:, :, 3) = I(:, :, 3)/Bw;

I(I > 1.0) = 1.0;

imshow (I);


//Gray World

I = imread('image');

Rw = mean(I(:, :, 1));

Gw = mean(I(:, :, 2));

Bw = mean(I(:, :, 3));


I(:, :, 1) = I(:, :, 1)/Rw;

I(:, :, 2) = I(:, :, 2)/Gw;

I(:, :, 3) = I(:, :, 3)/Bw;

I = I * 0.5;

imshow(I);

A17: Basic Video Processing

This activity shows basic video processing. Using a video of an ink diffusing in water, the are of the ink in the diffused water was determined.


Video of Ink Diffusion

Cropping the video so that only the area of diffusion can be viewed, the video was converted to many frames of still images. With this images, the threshold was determined using GIMP and then the images were binarized for area estimation.


Through pixel counting, the results are showed in the graph below on the left. Comparing this with the theoretical values in figure 5 from Lee S., et al, 2004,we can see that there are errors in our data. This is due to the pixel counting method. Not all of the images that were pixel counted are ink.