Color Creation and Enhancement AW00123402000
170 Basler ace USB 3.0
The Color Transformation Matrix
The color transformation feature processes red, green, and blue pixel data made available for each
pixel (Section 7.3 on page 160) and uses a transformation matrix to deliver modified red, green, and
blue pixel data for each pixel.
The RGB to RGB color matrix transformation for each pixel is performed by premultiplying a 3 x 1
matrix containing R, G, and B pixel values, by a 3 x 3 matrix containing color transformation values
that modify color-specific gain.
You can set each color transformation value according to your choice. Each GainXY position can
be populated with a floating point value ranging from -8.0 to +7.96875 by using the Color
Transformation Value Selector to select one of the GainXY positions in the matrix and using the
Color Transformation Value parameter to enter a value for that position and thereby replace the
previous value.
A reference article that explains the basics of color matrix transformation for video data can be
found at:
http://www.its.bldrdoc.gov/publications/2437.aspx
Setting Color Transformation Matrix Values
You can set the Color Transformation Value Selector and Color Transformation Values from within
your application software by using the Basler pylon API. The following code snippet illustrates using
the API to set the values in the matrix. Note that the values in this example are just randomly
selected numbers and do not represent values that you should actually use.
// Select a position in the matrix
camera.ColorTransformationValueSelector.SetValue(ColorTransformationValueSelector_Gain00);
// Set the value for the selected position as a floating point value
camera.ColorTransformationValue.SetValue(1.5625);
// Select a position in the matrix
camera.ColorTransformationValueSelector.SetValue(ColorTransformationValueSelector_Gain01);
// Set the value for the selected position as a floating point value
camera.ColorTransformationValue.SetValue(-0.4375);
You can also use the Basler pylon Viewer application to easily set the parameters.
For more information about the pylon API and the pylon Viewer, see Section 3.1 on page 37.
When setting the transformation values, you will find that the transformation matrix
is already populated with color transformation values. They will correspond to unit
vectors, be related to previously set light source presets or result from a previous
application of the color transformation feature.