# Exactly how does AWB work?

Discussion in 'Digital Photography' started by Bob Williams, Dec 21, 2006.

1. ### Bob WilliamsGuest

I think I understand how custom WB works wherein one displays a white
card to the camera in the same light as the subject. This "tells" the
camera to make all areas of the subject that look exactly like the test
card, appear white
The camera must then adjust the gain of R,G,and B amplifiers so
the output of each color is equal ,e.g. 255,255,255. The assumption is
then made that if White is correct, then all colors are correct.

Even if the camera sees a surface that reflects pretty close to equal
amounts of RGB, e.g. somewhere around 128,128,128, it must assume that
it is being shown a color-unbiased gray card and adjusts the amplifier
gains accordingly.
But what does the camera "home in" on when it is in Auto WB Mode?
Does it assume that a typical scene "averages" out as medium gray?
I think not because I've taken LOTS of flower pictures where the scene
is very strongly biased toward a single color.
So, how does the camera know where to set the color balance in AWB Mode?
Bob Williams

Bob Williams, Dec 21, 2006

2. ### Guest

, Dec 21, 2006

3. ### Bob WilliamsGuest

wrote:

Hee,Hee,Hee
I'll be more explicit next time.
Bob Williams

Bob Williams, Dec 22, 2006
4. ### Matt IonGuest

Bob Williams wrote:
> I think I understand how custom WB works wherein one displays a white
> card to the camera in the same light as the subject. This "tells" the
> camera to make all areas of the subject that look exactly like the test
> card, appear white
> The camera must then adjust the gain of R,G,and B amplifiers so
> the output of each color is equal ,e.g. 255,255,255. The assumption is
> then made that if White is correct, then all colors are correct.
>
> Even if the camera sees a surface that reflects pretty close to equal
> amounts of RGB, e.g. somewhere around 128,128,128, it must assume that
> it is being shown a color-unbiased gray card and adjusts the amplifier
> gains accordingly.
> But what does the camera "home in" on when it is in Auto WB Mode?
> Does it assume that a typical scene "averages" out as medium gray?
> I think not because I've taken LOTS of flower pictures where the scene
> is very strongly biased toward a single color.
> So, how does the camera know where to set the color balance in AWB Mode?
> Bob Williams
>

http://www.cambridgeincolour.com/tutorials/white-balance.htm

Matt Ion, Dec 22, 2006
5. ### bugbearGuest

Matt Ion wrote:

Wow. Great science, clearly explained.

on the rest of that site.

BugBear

bugbear, Dec 22, 2006
6. ### Matt IonGuest

bugbear wrote:
> Matt Ion wrote:
>
>
>
> Wow. Great science, clearly explained.
>
> on the rest of that site.

Yeah, I actually just found that site in a Google search, but I've bookmarked it
now... quite well-done.

Matt Ion, Dec 23, 2006
7. ### Matt IonGuest

bugbear wrote:
> Matt Ion wrote:
>
>
>
> Wow. Great science, clearly explained.
>
> on the rest of that site.

By the way, one trick I've read of (haven't tried it yet, but it sounds
sensible) for a custom-WB target, is to just snap the lid of a Pringles can or
something similar over your lens - it's a pretty even white, and translucent
enough to be well-backlit. Note that the target used doesn't have to be
bright-white, as WB is looking only at the BALANCE of color, not the brightness
of it (thus the name); all that's required is an even area of an even mix of all
colors. Most common is a light grey, which is less likely to overwhelm the
camera in bright light, and also less likely to show dirt, smudges, etc. that

Matt Ion, Dec 23, 2006
8. ### Bob WilliamsGuest

Bob Williams wrote:
> I think I understand how custom WB works wherein one displays a white
> card to the camera in the same light as the subject. This "tells" the
> camera to make all areas of the subject that look exactly like the test
> card, appear white
> The camera must then adjust the gain of R,G,and B amplifiers so
> the output of each color is equal ,e.g. 255,255,255. The assumption is
> then made that if White is correct, then all colors are correct.
>
> Even if the camera sees a surface that reflects pretty close to equal
> amounts of RGB, e.g. somewhere around 128,128,128, it must assume that
> it is being shown a color-unbiased gray card and adjusts the amplifier
> gains accordingly.
> But what does the camera "home in" on when it is in Auto WB Mode?
> Does it assume that a typical scene "averages" out as medium gray?
> I think not because I've taken LOTS of flower pictures where the scene
> is very strongly biased toward a single color.
> So, how does the camera know where to set the color balance in AWB Mode?
> Bob Williams
>

After Googling on a bunch of sites explaining Automatic White Balance,
it appears that it is a very complicated subject.
Apparently different manufacturers use different proprietary algorithms
to accomplish AWB. Some companies do it better than others.
One method that seems reasonable to me is for the camera to look for the
brightest group of pixels in the entire image. In most images the
brightest spot will be a specular highlight, i.e. a direct reflection of
the light source itself. These can be found, for instance, reflected in
the eye of a person or animal or from a shiny curved surface as in
jewelry. If there ARE specular highlights, the camera can tell from the
color distribution in the highlight, the color temperature of the light
source.
Now, for a uniform matte surface, there probably would not be ANY
specular highlights. So some other method (algorithm) must be used.
If the matte surface is extremely biased to one color and has no
specular highlights, I have no clue how a correct AWB can be created.
Yet from my own experience I have taken many macro shots of leaves or
flowers in which the image is extremely biased toward a single color and
the results were quite accurate.
Perhaps, in real world subjects, unnoticed by me, there were a few
little specular reflections that the camera recorded and from which it
could determine the color distribution.
An interesting discussion on AWB is the following site.
I don't follow all the math but the concepts are pretty clear.
See: www.iis.sinica.edu.tw/JISE/2006/200605_02.pdf
Bob Williams

Bob Williams, Dec 23, 2006