Operator Library: Color
BAYER5x5Linear 算子通过 Bayer 输入图像重建 RGB 图像。从技术上讲,Bayer 原始图像是由交替的红、绿、蓝像素组成的灰度图像。BAYER5x5Linear 通过双线性重建从 Bayer 相机获取 RGB 图像。输入 link 必须是 Bayer 图像的 5x5 kernel。
底层算法是一种无专利的高 Quality 线性实现。
算子输入为灰度图像,输出为彩色图像。因此,输出 Bit Width 会按三倍再加每个分量 4 个精度 bit 的比例增加。例如,8 bit 的灰度输入图像将被重建为 3 * (8 + 4) bit 的彩色图像。如果不需要增加的精度 bit,可以使用算子 RND 或 ShiftRight 将其丢弃。
相机的 Bayer 阵列配置必须与算子设置相匹配。 使用参数 BayerInit 更改算子设置。 传感器上的 Bayer 阵列可能有四种不同的映射方式:
-
GreenFollowedByRed

-
RedFollowedByGreen

-
BlueFollowedByGreen

-
GreenFollowedByBlue

这些图显示了传输到 frame grabber 的图像的左上角。通常,这是相机传感器的左上角,但如果您在相机的 region of interest 中进行了设置,则可能会发生变化。传感器像素覆盖有图中所示四种不同的 Bayer 模式之一。请选择与相机图像传感器对应的 Bayer 模式。
| 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 | |
|---|---|
| 键入 | 动态/静态读/写参数 |
| 默认 | GreenFollowedByRed |
| 范围 | {GreenFollowedByRed, GreenFollowedByBlue, RedFollowedByGreen, BlueFollowedByGreen} |
|
相机的 Bayer 阵列配置必须与算子设置相匹配。请参阅上文说明。 |
|
| ImplementationType | ||||
|---|---|---|---|---|
| 键入 | 静态写参数 | |||
| 默认 | AUTO | |||
| 范围 | (AUTO, EmbeddedALU, LUT) | |||
|
Parameter ImplementationType influences the implementation strategy of the operator, i.e., which logic elements are used for implementing the operator. 您可以选择以下值之一: AUTO: When the operator is instantiated, the optimal implementation strategy is selected automatically based on the parametrization of the connected links. EmbeddedALU: 算子使用 FPGA 的嵌入式算术逻辑元件,这些元件不是基于 LUT 的。 LUT: 算子使用 FPGA 的 LUT 逻辑。
|
||||
以下示例展示了 BAYER5x5Linear 算子的使用方法:
-
Examples - 该示例展示了使用 5x5 滤波器对 Bayer RAW 图案进行去马赛克处理。
-
'Bayer 5x5 Demosacing with White Balancing'
示例 - 该示例展示了使用 5x5 滤波器对 Bayer RAW 模式进行去马赛克处理。 此外,还添加了用于色彩校正的白平衡功能。
-
Examples - 该示例展示了对双线性线扫描相机的 Bayer RAW 图案进行去马赛克处理,其颜色模式为 Red/BlueFollowedByGreen_GreenFollowedByBlue/Red
-
示例 - 该示例展示了具有颜色模式 Red/BlueFollowedByBlue/Red_GreenFollowedByGreen 的双线性线扫描相机的 Bayer RAW 模式去马赛克。
-
'Bayer Demosaicing a Line Scan Camera with 8 Bit BiColor Bayer Pattern'
示例 - 该示例展示了具有双色 Bayer 模式的 CXP-12 线扫描相机的 8 位 Bayer RAW 模式去马赛克: BiColorRGBG、BiColorGRGB、BiColorBGRG 和 BiColorGBGR,例如适用于 racer 2 L 相机。此外,该示例还包含 一个线扫描触发模块 和一个白平衡模块。
-
'Bayer Demosaicing a Line Scan Camera with 10 Bit BiColor Bayer Pattern'
示例 - 该示例展示了具有双色 Bayer 模式的 CXP-12 线扫描相机的 10 位 Bayer RAW 模式去马赛克: BiColorRGBG、BiColorGRGB、BiColorBGRG 和 BiColorGBGR,例如适用于 racer 2 L 相机。此外,该示例还包含 一个线扫描触发模块 和一个白平衡模块。
-
'Bayer Demosaicing a Line Scan Camera with 12 Bit BiColor Bayer Pattern'
示例 - 该示例展示了具有双色 Bayer 模式的 CXP-12 线扫描相机的 10 位 Bayer RAW 模式去马赛克: BiColorRGBG、BiColorGRGB、BiColorBGRG 和 BiColorGBGR,例如适用于 racer 2 L 相机。此外,该示例还包含 一个线扫描触发模块 和一个白平衡模块。

![[注意]](../common/images/admon/note.png)
上一页

