Aptina Color Correction Technology Overview

Aptina Color Correction Technology Overview

In order to achieve good color rendition and color saturation, interpolated colors of all pixels are subjected to color correction. The color correction is a linear transformation of the image with a 3 x 3 color correction matrix. The optimal values of the correction matrix elements depend on the spectrum of light incident on the sensor. They can be either programmed by the user or automatically selected by the auto white balance algorithm.

Color correction is done after "Second Black Level Subtraction" and before "Aperture Correction". The interpolated RGB values are transformed by the color correction matrix into color corrected R', G', and B' values. The color correction matrix is uploaded from the AWB firmware driver into the corresponding registers in the color pipeline when AWB has settled and CCM position adjusted.  See the ColorPipe User Guide for details.

The color correction matrix consists of 9 values, each of which represents a digital gain factor on the corresponding color channel with the diagonal elements representing the gain factors on each color channel and the off diagonal terms representing the gain factors to compensate for color crosstalk. The matrix is normalized so that the sum of each row is 1.


Auto White Balance

The auto white balance (AWB) algorithm is designed to compensate the effects of changing spectra of the scene illumination on the quality of the color rendition. The algorithm consists of two major parts:

    • A measurement engine performing statistical analysis of the image.
    • A firmware driver performing the selection of the optimal color correction matrix, digital, and sensor core analog gains.

The statistics engine gathers information predominantly at edges in the image. The AWB measurement engine has additional hue statistic collection where an edge is determined by both luma and hue. The driver keeps analog gain ratio of left and right matrices corresponding to two opposite illuminations red-rich (tungsten) and blue-rich (daylight), respectively. The AWB driver analyzes measurement engine data and sets appropriate digital AWB gains (awb.GainR, awb.GainG, awb.GainB) and matrix position (awb.CCMposition). The matrix position defines the current matrix coefficients and analog gain ratio.


Measurement Engine

The white balance statistic is collected on the interpolated RGB values. For each pixel to satisfy the gray pixel criteria, the follow conditions must be met:

    • The pixel is within the AWB window frame, AND
    • The pixel is gray, AND
    • The pixel is within the luma range (Y), AND
    • The pixel is on the edge OR the pixel is "looks like" gray

The AWB statistical engine outputs statistics on Red, Gray, Blue channel and additional edge related statistics.

Related content