## Sunday, July 02, 2006

### AE autoexposure

The most important aspect of the exposure duration is to guarantee that the acquired image falls in a good region of the sensor’s sensitivity range. The imaging community uses a measure called exposure value (EV) to specify the relationship between the f-number, F, and exposure duration, T :
f-number or focal ration $$f/#=f/D$$, where f is the focal length, and D is the diameter of the entrance pupil.
$$EV = log_2 (F^2/T) = 2 log_2(F) - log_2(T)$$
The exposure value becomes smaller as the exposure duration increases, and it becomes larger as the f-number grows.
Most auto exposure algorithms work this way:
Take a picture with a pre-determined exposure value (EVpre)
Convert the RGB values to brightness, B.
Derive a single number Bpre (like center-weighted mean, median, or more complicated weighted method as in matrix-metering) from the brightness picture
Based on linearity assumption and equation (1), the optimum exposure value EVopt should be the one that, the picture we take at this EVopt will give us a number close to an pre-defined ideal value Bopt, or: [tex] EV_{opt} = EV_{pre} + log_2(B_{pre}) - log_2(B_{opt}).

The ideal value Bopt for each algorithm is typically selected empirically. For the moment, however, let’s assume that Bopt is known.

Different algorithms mainly differ in how they derive the single number Bpre from the picture. Some simple algorithms include:

Mean: Bpre is the mean brightness across the whole picture.

Center-Weighted Mean: Bpre is the weighted mean of the center area and the rest area. It puts more weight on the center part than the surrounding area. There are many alternatives as how you choose the center area and how much weight for it. Here we choose center to be the center 25% area and weights [0.8 0.2] for center and surrounding respectively.

Spot: Bpre is the mean of the center 3% area.

Median: Bpre is the median brightness of the whole picture.

Green: Bpre is the mean of the green channel only.