Operator Library: Color
The operator ColorTransform transforms the RGB stream at the input into an RGB stream with weighted components. The transformation is performed by a 3x3 matrix multiplication with the input RGB vector.
The transformation matrix is defined by the parameter Coefficients. This parameter is a 3x3 matrix containing double precision coefficients. The following formula represents the transformation algorithm.
For calculation fixed point precision values are used. Parameters Precision and Resolution specify the multiplication precisions.
-
Precision defines the number of bits used to encode the coefficients.
-
Resolution defines the number of fractional bits of a coefficient.
For example a precision of 8 bit and a resolution of 6 bits will result in coefficients within the range .
Signed values are allowed as coefficients, if the input link is signed or the field parameter Coefficients is set to static. When the field parameter Coefficients is set to dynamic (i.e., transformation coefficients can be altered during runtime), the output link is always signed. One of the precision bits is used as the signed bit.
The results of the matrix multiplication are provided. They are rounded to the next integer value. The output bit width is automatically determined from the input bit width and parameter settings.
Less Resources for Static Parameter | |
---|---|
The operator requires less FPGA resources if the parameter Coefficients is set to static. |
Property | Value |
---|---|
Operator Type | O |
Input Link | I, image data input |
Output Link | O, image data input |
Resolution | |
---|---|
Type | static parameter |
Default | 8 |
Range | auto |
Defines the number of fractional bits of a coefficient. The range depends on the input bit width and the value of parameter Precision. Mind the following limitations: Resolution > 0 Precision > Resolution Precision + Resolution <= 32
|
Precision | |
---|---|
Type | static parameter |
Default | 16 |
Range | auto |
Defines the number of bits to encode the whole coefficient - resolution bits and sign bit included. The range depends on the input bit width and the value of parameter Precision. Mind the following limitations: Resolution > 0 Precision > Resolution Precision + Resolution <= 32
|
Coefficients | ||||
---|---|---|---|---|
Type | dynamic/static read/write parameter | |||
Default | identity matrix | |||
Range | All Coefficients unsigned: Any Coefficient signed: | |||
The coefficient matrix initialized with the identity transformation. All coefficients of the matrix are treated as signed numbers by the operator. The coefficients are double numbers.
|
The use of operator ColorTransform is shown in the following examples:
-
'Functional Example for Specific Operators of Library Color, Base and Memory'
Examples - Demonstration of how to use the operator