Wednesday, September 17, 2008

Activity 15 - Color Image Processing

In this activity, images having unbalanced colored images were enhanced by;

(1) White Balancing,
(2) Gray World Balancing

White Balancing:

White balancing technique uses a known white object from the image for balancing. The red, green and blue of the RGB values of the known white object in the image is used as "NORMALIZING" or as divider for all the RGB values of all the pixels in the image.

Gray World Balancing:

Gray balancing technique uses the mean of all the red, green and blue values present in the image as the divider for all the RGB values of the pixels present in the image.

Here are some examples of images that were white balanced and gray balanced:

For this activity, I will give myself a grade of 7 out of 10 because of the late submission.
I would like to acknowledge Mark Leo for helping me debug errors on my program.

Appendix:

Source code for White Balancing created in Scilab:

I = imread("C:\Documents and Settings\AP186user15\Desktop\act15\outside - daylight.jpg");
imshow(I);
n = size(I);
RGB = round(locate(1,flag=1));
r = I((RGB(1)),(RGB(2)),1);
g = I((RGB(1)),(RGB(2)),2);
b = I((RGB(1)),(RGB(2)),3);
Ibal(:,:,1) = I(:,:,1)/r;
Ibal(:,:,2) = I(:,:,2)/g;
Ibal(:,:,3) = I(:,:,3)/b;

index=find(Ibal>1.0);
Ibal(index)=1.0;
//Inew(:,:,1) = Ibal(:,:,1)/max(I(:,:,1));
//Inew(:,:,2) = Ibal(:,:,2)/max(I(:,:,2));
//Inew(:,:,3) = Ibal(:,:,3)/max(I(:,:,3));
imwrite(Ibal,"C:\Documents and Settings\AP186user15\Desktop\act15\outside - daylight_bal.jpg");

Source code for Gray World Balancing:
I = imread("C:\Documents and Settings\AP186user15\Desktop\act15\o- incandescent.jpg");
//imshow(I);
//n = size(I);
//RGB = round(locate(1,flag=1));
r = mean(I(:,:,1));
g = mean(I(:,:,2));
b = mean(I(:,:,3));
Ibal(:,:,1) = I(:,:,1)/r;
Ibal(:,:,2) = I(:,:,2)/g;
Ibal(:,:,3) = I(:,:,3)/b;

index=find(Ibal>1.0);
Ibal(index)=1.0;
Ibal = 0.75*Ibal;
//Inew(:,:,1) = Ibal(:,:,1)/max(I(:,:,1));
//Inew(:,:,2) = Ibal(:,:,2)/max(I(:,:,2));
//Inew(:,:,3) = Ibal(:,:,3)/max(I(:,:,3));
imwrite(Ibal,"C:\Documents and Settings\AP186user15\Desktop\act15\o- incandescent_bal_gray.jpg");




No comments: