MT9D115
www.onsemi.com
26
CAMERA FUNCTIONS
Simple Rule-based Auto Exposure
The AE algorithm performs automatic adjustments of the
image brightness by controlling exposure time and analog
gains of the sensor core as well as digital gains applied to the
image.
Auto exposure is implemented by a firmware (FW) driver
that analyzes image statistics collected by the exposure
measurement engine, makes a decision, and programs the
sensor core and color pipeline to achieve the desired
exposure. The measurement engine subdivides the image
into 16 windows organized as a 4 × 4 grid.
An AE algorithm mode is available: average brightness
tracking (ABT).
The ABT AE uses a constant average tracking algorithm
where a target brightness value is compared to a current
brightness value, and the gain and integration time are
adjusted accordingly to meet the target requirement.
AE Driver
DRT exposure mode is activated during preview. This
mode can also be enabled during video capture mode. The
DRT exposure mode relies on the statistics engine to track
speed and amplitude of the change of the overall luminance
in the selected windows of the image.
Backlight compensation is achieved by weighting the
luminance in the center of the image higher than the
luminance on the periphery. Other algorithm features
include the rejection of fast fluctuations in illumination
(time averaging), control of speed of response, and control
of the sensitivity to the small changes. While the default
settings are adequate in most situations, the user can
program target brightness, measurement window, and other
parameters.
The driver calculates image brightness based on average
luma values received from 16 programmable equal-size
rectangular windows forming a 4 × 4 grid. In preview mode,
16 windows are combined in two segments: central and
peripheral. The central segment includes four central
windows. All remaining windows belong to the peripheral
segment. Scene brightness is calculated as average luma in
each segment taken with certain weights.
The driver changes AE parameters (integration time,
gains, and so on) to drive brightness to the programmable
target. The value of the single step approach to the target
value can be controlled.
To avoid unwanted reaction of AE on small fluctuations
of scene brightness or momentary scene changes, the AE
driver uses a temporal filter for luma and a threshold around
the AE luma target. The driver changes AE parameters only
if the filtered luma is larger than the AE target step and
pushes the luma beyond the threshold.
Evaluative Algorithm
A scene-evaluative AE algorithm is available for use in
snapshot mode. The algorithm performs scene analysis and
classification with respect to its brightness, contrast, and
composure and then decides to increase, decrease, or keep
the original exposure target. It makes the most difference for
backlight and bright outdoor conditions.
Accelerated Settling During Overexposure
The AE speed is direction-dependent. Transitioning from
overexposure to target can take more time than transitioning
from underexposure. The AE driver has a mode that speeds
up AE for overexposed scenes.
The AE driver counts the number of AE windows whose
average brightness is equal to or greater than some value,
250 by default. For a scene that has saturated regions, the
average luma is underestimated because of signal clipping.
The driver compensates underestimation by a factor that can
be defined.
Exposure Control
To achieve the required amount of exposure, the AE driver
adjusts the sensor integration time, gains, ADC reference,
and IFP digital gains. In addition, ae_base_target (ID = 2,
offset = 0x4F) is available for the user to adjust the overall
brightness of the scene.
Flicker Detection and Avoidance
Flicker occurs when the integration time is not an integer
multiple of the period of the light intensity. The automatic
flicker detection block does not compensate for the flicker,
but rather avoids it by detecting the flicker frequency and
adjusting the integration time.
To reject flicker, integration time is typically adjusted in
increments of steps. The incremental step specifies the
duration in row times equal to one flicker period. Thus,
flicker is rejected if integration time is kept to an integral
factor of the flicker period.
Flicker cannot be avoided for integration times below the
light intensity period (10 ms for 50 Hz environment).
Flicker shows up in the image as horizontal bars that roll
up or down. The MCU looks for these rolling bars using
a thin horizontal window, which outputs luma average and
is applied to 48 points in the upper half of the image. The
MCU repeats the same sampling on the next frame; 48
samples from the previous frame are subtracted from
corresponding samples from the current frame. Skipping
more frames between subtraction can be set by a variable.
The MCU then smooths the 48 sampling points, applies an
amplitude threshold to avoid false detection, and looks at the
resulting waveform. If flicker is present, the waveform
should have a frequency within the search range. Assuming
the flicker power is a sine wave, subtracting two frames
results in:
sin(wt) * sin(wt ) a) + 2 sin
ǒ
a
2
Ǔ
@ cos
ǒ
wt )
ǒ
a
2
Ǔ
Ǔ
(eq. 18)
which is a cosine wave of the original frequency.