Operator WhiteBalance

Operator Library: Color

WhiteBalance 算子使用三个独立的系数对 RGB 输入流的三个颜色分量进行缩放。 该算子的一个用途是手动白平衡。 每个颜色分量都使用由参数定义的值进行缩放 RedCoefficient, GreenCoefficient 和 BlueCoefficient。 乘法的范围和精度使用参数进行定义 ResolutionBits 和 RangeBits. RangeBits 定义了 Scaling 范围。 该范围为 [0, 2^RangeBits[。 ResolutionBits 定义了 Scaling 的步长,即 。 结果四舍五入到下一个整数值,并从输出链路 O 输出。

I/O Property

Property 值
Operator Type O
Input Link I, image data input
Output Link O, image data input

Supported Link Format

Link Parameter Input Link I Output Link O
Bit Width [3, 63] 3*(InputBitWidth/3 + RangeBits) <= 64
Arithmetic unsigned as I
Parallelism any as I
Kernel Columns 1 as I
Kernel Rows 1 as I
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} as I
Color Format VAF_COLOR as I
Color Flavor FL_RGB as I
Max. Img Width any as I
Max. Img Height any as I

参数

ResolutionBits
键入 static 参数
默认 8
范围 [1, 16]

此参数定义乘法的精度,即系数参数的步长。

RangeBits
键入 static 参数
默认 2
范围 [1, 8]

此参数定义乘法范围。 此参数会影响输出 Bit Width。 输出 Bit Width 不得超过 64 Bit。

RedCoefficient
键入 动态/静态读/写参数
默认 1
范围

此参数定义对输入红色分量进行 Scaling 的系数。 输入的浮点系数会四舍五入到最接近的有效定点值(请参阅 RangeBits 和 ResolutionBits)。

GreenCoefficient
键入 动态/静态读/写参数
默认 1
范围

此参数定义对输入绿色分量进行 Scaling 的系数。 输入的浮点系数会四舍五入到最接近的有效定点值(请参阅 RangeBits 和 ResolutionBits)。

BlueCoefficient
键入 动态/静态读/写参数
默认 1
范围

此参数定义对输入蓝色分量进行 Scaling 的系数。 输入的浮点系数会四舍五入到最接近的有效定点值(请参阅 RangeBits 和 ResolutionBits)。

使用示例

以下示例展示了 WhiteBalance 算子的使用方法: