Operator Library: Color
The operator BAYER5x5Linear reconstructs an RGB image from a Bayer input image. Technically, a Bayer raw image is a grayscale image which is composed from alternating red, green and blue pixels. BAYER5x5Linear acquires an RGB image from a Bayer camera through a bilinear reconstruction. The input link must be a 5x5 kernel of a Bayer image.
The underlying algorithm is a patent free high quality linear implementation.
The operator input is a grayscale image while the output is a color image. Therefore, the output bit width is increased by a factor of three plus 4 precision bits per component. For example, an 8 bit grayscale input image will be reconstructed into a 3 * (8 + 4) bit color image. If the added precision bits are not required they can be discarded using operator RND or ShiftRight.
The Bayer array configuration of the camera must match the operator settings. The operator setting is changed using parameter BayerInit. Four different mappings of the Bayer array on the sensor are possible:
-
GreenFollowedByRed
-
RedFollowedByGreen
-
BlueFollowedByGreen
-
GreenFollowedByBlue
The figures show the top left corner an image transferred to the frame grabber. In general, this is the top left corner of the camera's sensor but could change if you set a region of interest in the camera. The sensor pixel are overlaid with one of the four different Bayer patterns shown in the figures. Select the Bayer pattern corresponding to the image sensor of your camera.
Property | Value |
---|---|
Operator Type | O |
Input Link | I, image data input |
Output Link | O, image data input |
Link Parameter | Input Link I | Output Link O |
---|---|---|
Bit Width | [1, 16] | (InputBitWidth + 4) * 3 |
Arithmetic | unsigned | as I |
Parallelism | any | as I |
Kernel Columns | 3 | 1 |
Kernel Rows | 3 | 1 |
Img Protocol | {VALT_IMAGE2D, VALT_LINE1D} | as I |
Color Format | VAF_GRAY | VAF_COLOR |
Color Flavor | FL_NONE | FL_RGB |
Max. Img Width | any | as I |
Max. Img Height | any | as I |
BayerInit | |
---|---|
Type | dynamic/static read/write parameter |
Default | GreenFollowedByRed |
Range | {GreenFollowedByRed, GreenFollowedByBlue, RedFollowedByGreen, BlueFollowedByGreen} |
The Bayer array configuration of the camera must match the operator settings. See descriptions above. |
ImplementationType | ||||
---|---|---|---|---|
Type | static write parameter | |||
Default | AUTO | |||
Range | (AUTO, EmbeddedALU, LUT) | |||
Parameter ImplementationType influences the implementation strategy of the operator, i.e., which logic elements are used for implementing the operator. You can select one of the following values: AUTO: When the operator is instantiated, the optimal implementation strategy is selected automatically based on the parametrization of the connected links. EmbeddedALU: The operator uses embedded arithmetic logic elements of the FPGA that are not LUT based. LUT: The operator uses the LUT logic of the FPGA.
|
The use of operator BAYER5x5Linear is shown in the following examples:
-
Examples - The example shows the demosaicing of a Bayer RAW pattern using a 5x5 filter.
-
'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.