Color Space Conversion and Correction - 2.4 English

Video Processing Subsystem Product Guide (PG231)

Document ID
Release Date
2.4 English

There are many variations that cause difficulties in accurately reproducing color in imaging systems. These can include:

Spectral characteristics of the optics (lens, filters)

Lighting source variations like daylight, fluorescent, or tungsten

Characteristics of the color filters of the sensor

The Color Space Converter/Correction function provides a method for correcting the image data for these variations. This fundamental block operates on either YUV or RGB data.

As an example, following one of the three color channels through an imaging system from the original light source to the processed image helps understand the functionality of this core.

The blue color channel is a combination of the blue photons from the scene, multiplied by the relative response of the blue filter, multiplied by the relative response of the silicon to blue photons. However, the filter and silicon responses might be quite different from the response of the human eye, so blue to the sensor is quite different from blue to a human being.

This difference can be corrected and made to more closely match the blue that is acceptable to human vision. The Color Space Converter/Correction function multiplies the pixel values by some coefficient to strengthen or weaken it, creating an effective gain. At the same time a mixture of green or red can be added to the blue channel. To express this processing mathematically, the new blue ( Bc ) is related to the old blue ( B ), red ( R ), and green ( G ) according to:

Equation 3-4 Bc = K1 x R + K2 x G + K3 x B

where K1 , K2 , and K3 are the weights for each of the mix of red, green, and blue to the new blue.

Extending this concept, a standard 3 x 3 matrix multiplication can be applied to each of the color channels in parallel simultaneously. This is a matrix operation where the weights define a color-correction matrix. In typical applications, color-correction also contains offset compensation to ensure black [0,0,0] levels are achieved.

The following matrix operations can also be used for color correction:

Equation 3-5 pg231-designing00006.jpg

Equation 3-6 pg231-designing00008.jpg

Note: The K coefficients are presented in S3.12 fixed point format (1 sign bit, 3 integer bits, 12 fractional bits). The 16-bit signed integer values (2’s compliment) are equivalent to real numbers in the [-8 .. 8] range. The offset values O have a width of the data width plus 1. It is a signed integer with a range of [-2 Data_Width , 2 Data_Width-1 ].