A colored digital image is an array of pixels each having red, green and blue light overlaid in various proportions, Per pixel, the color captured by a digital color camera is an integral of the product of the spectral power distribution of the incident light source S(l), the surface reflectance r(l) and the spectral sensitivity of the camera h(l).
White Balancing
This setting allows the user to select the white balancing constants appropriate for the capturing conditions.
White Balance Settings
Daylight - not all cameras have this setting because it sets things as fairly ‘normal’ white balance settings.
Incandescent/ Tungsten - this mode is usually symbolized with a little bulb and is for shooting indoors, especially under tungsten (incandescent) lighting (such as bulb lighting). It generally cools down the colors in photos.
Flourescent - this compensates for the ‘cool’ light of fluorescent light and will warm up your shots.
Cloudy - this setting generally warms things up a touch more than ‘daylight’ mode.
There are two popular algorithms of achieving automatic white balance. The first is Reference White Algorithm and the second is the Gray World Algorithm.
In the Reference White Algorithm, you capture an image using an unbalanced camera and use the RGB values of a known white object as the divider.
In the Gray World Algorithm, it is assumed that the average color of the world is gray.
Using a cloudy white balance, the color of the original image is yellowish. Using reference white, the image became whiter. And when we use gray world, the image is also whiter than the original but it is darker than the image using reference white.
Using an incandescent white balance, the image is bluish in color. Using reference white, the image became whiter and brighter than the original. Using gray world, the image is darker but whiter than the original.
Using daylight settings, the image became whiter in the reference white than the gray world. It also becomes brighter using reference white.
Using flourescent white balance. The image become white using both reference white and gray world. But i think it is brighter using gray world.
Using incandescent white balance, the image is bluish. After implementing reference white, the color of the leaves became green and the paper became white. After implementing gray world, the leaves became green, and the paper is close to gray.
I think that the reference white algorith is better than the gray world because of the results in the images.
-- code --
//white balance
stacksize(20000000);
image = imread('rix.jpg');
im = imread('rix-white.jpg');
RW = mean(im(:,:,1));
GW = mean(im(:,:,2));
BW = mean(im(:,:,3));
new = zeros(image);
new(:,:,1) = image(:,:,1)./RW;
new(:,:,2) = image(:,:,2)./GW;
new(:,:,3) = image(:,:,3)./BW;
maxall = max(max(max(new)));
newim = new./maxall;
imwrite(newim,'rix-new-white.jpg');
//gray world
stacksize(20000000);
image = imread('rix1.jpg'C/3B
new = zeros(image);
new(:,:,1) = image(:,:,1)./mean(image(:,:,1));
new(:,:,2) = image(:,:,2)./mean(image(:,:,2));
new(:,:,3) = image(:,:,3)./mean(image(:,:,3));
maxall = max(max(max(new)));
newim = new./maxall;
imwrite(newim,'rix1-new-gray.jpg');
Acknowledgements
Activity 15 manual
http://digital-photography-school.com/blog/introduction-to-white-balance/
Benj - for the help with the codes
Grade:
10/10
- because I think I implemented the algorithms well. The color of the images were improved. :)