Operator Library: Base
The operator ConvertPixelFormat tries to preserve as much information as possible, while arithmetic and bit width are adjusted to a desired output pixel format. Thus the operator allows the definition of the bit width and arithmetic at the output link.
The main principle of algorithm is twofold:
-
Change the arithmetic by clipping
- unsigned to signed: the MSB at the output is used as a sign bit
- signed to unsigned: clipping to positive values i.e. if a value is less than 0 it is set to zero
-
Change the bit width y keeping the relative brightness
- if the output bit width is increased, the value is left shifted to meet the desired bit width
- if the output bit width is decreased, the value is divided and rounded to meet the desired bit width
Thus the output value can be determined by:
Input Bit Width | Output Bit Width | Input Arithmetic | Output Arithmetic | Input Value | Output Value | Comment | ||
---|---|---|---|---|---|---|---|---|
Decimal | Binary | Decimal | Binary | |||||
4 | 5 | unsigned | unsigned | 10 | 1010 | 20 | 10100 | value * 2 |
5 | 4 | unsigned | unsigned | 15 | 1111 | 8 | 1000 | value divided by 2 and rounded |
5 | 4 | unsigned | unsigned | 31 | 11111 | 15 | 1111 | value clipped to maximum |
4 | 4 | unsigned | signed | 11 | 1011 | 6 | 0100 | value divided by 2 and rounded |
4 | 4 | signed | unsigned | 4 | 0100 | 8 | 1000 | value * 2 |
5 | 4 | signed | unsigned | 10 | 01010 | 10 | 1010 | value kept |
5 | 4 | signed | unsigned | -2 | 11110 | 0 | 0000 | value clipped to 0 |
5 | 4 | signed | signed | -7 | 11001 | -4 | 1100 | value divided by 2 and rounded |
Table 33. Examples
For color links, each color component is processed individually.
The range of the input bit width is [1, 64]. For signed inputs, the range is [2, 64]. For unsigned color inputs, the range is [3, 63] and for signed color, the range is [6, 63]. |
|
The range of the output bit width is [1, 64]. For signed outputs, the range is [2, 64]. For unsigned color outputs, the range is [3, 63] and for signed color, the range is [6, 63]. |
The use of operator ConvertPixelFormat is shown in the following examples:
-
Figure 215, 'ConvertPixelFormat Operator Added for 16Bit Output'
Tutorial - User ConvertPiyelFormat to change DMA bit width.
-
'Example for the DMAFromPC Operator on the imaFlex CXP-12 Quad Platform'
Examples - Demonstration of how to use the operator using the example of shading correction
-
Examples - The example shows the demosaicing of a Bayer RAW pattern using a 3x3 filter.
-
Examples - The example shows the demosaicing of a Bayer RAW pattern using a 5x5 filter.
-
'Bayer 3x3 Demosacing with White Balancing'
Examples - The example shows the demosaicing of a Bayer RAW pattern using a 3x3 filter. Moreover, a white balancing for color correction is added.
-
'Bayer 5x5 Demosacing with White Balancing'
Examples - The example shows the demosaicing of a Bayer RAW pattern using a 5x5 filter. Moreover, a white balancing for color correction is added.
-
Examples - The example shows the demosaicing of a Bayer RAW pattern of a bilinear line scan camera with color pattern Red/BlueFollowedByGreen_GreenFollowedByBlue/Red
-
Examples - The example shows the demosaicing of a Bayer RAW pattern of a bilinear line scan camera with color pattern Red/BlueFollowedByBlue/Red_GreenFollowedByGreen
-
'Bayer Demosaicing a Line Scan Camera with 8 Bit BiColor Bayer Pattern'
Examples - This example shows the demosaicing of a Bayer 8 bit RAW pattern of a CXP-12 line scan camera with BiColor Bayer pattern: BiColorRGBG, BiColorGRGB, BiColorBGRG and BiColorGBGR, for example for the racer 2 L camera. In addition, the example contains a line scan trigger module and a white balancing module.
-
'Bayer Demosaicing a Line Scan Camera with 10 Bit BiColor Bayer Pattern'
Examples - This example shows the demosaicing of a 10 bit Bayer RAW pattern of a CXP-12 line scan camera with BiColor Bayer pattern: BiColorRGBG, BiColorGRGB, BiColorBGRG and BiColorGBGR, for example for the racer 2 L camera. In addition, the example contains a line scan trigger module and a white balancing module.
-
'Bayer Demosaicing a Line Scan Camera with 12 Bit BiColor Bayer Pattern'
Examples - This example shows the demosaicing of a 10 bit Bayer RAW pattern of a CXP-12 line scan camera with BiColor Bayer pattern: BiColorRGBG, BiColorGRGB, BiColorBGRG and BiColorGBGR, for example for the racer 2 L camera. In addition, the example contains a line scan trigger module and a white balancing module.
-
'Co-Processor Large Filter Calculation'
Examples - The coprocessor feature of the microEnable IV VD1-CL is shown. As an example, a large filter kernel is calculated.
-
Examples - The average of two acquired images is calculated to reduce noise.
-
Examples - Shows how to split an merge image streams. Appends a trailer to the image.
-
'2D Shading Correction / Flat Field Correction'
Examples - The example shows the implementation of a 2D shading correction. Correction values are stored in frame grabber RAM. The applet performs a high precision offset and gain correction.
-
'1D Shading Correction Using Block RAM'
Examples - The example shows an 1D shading correction. The correction values are stored in block RAM memory.
-
'1D Shading Correction Using Frame Grabber RAM'
Examples - The example shows an 1D shading correction. The correction values are stored in Frame Grabber RAM.