Operator Library: Arithmetics
运算符 RND 执行带舍入和截断的右移操作,将结果输出到指定的 Bit Width。舍入的位数由参数 bits2Round 指定。
实现的舍入方法为远离零的半舍入(Round half away from zero)。颜色分量分别进行舍入。
示例
-
Input = 4 Bit 无符号,Input Value = 7,bits2Round = 2
Output = 2 Bit 无符号,Output Value = 2
-
Input = 5 Bit 有符号,Input Value = -13,bits2Round = 2
Output = 3 Bit 有符号,Output Value = -3
-
Input = 4 Bit 无符号,Input Value = 15,bits2Round = 2
Output = 2 Bit 无符号,Output Value = 3 注意:输出已被截断至最大可能值。
| bits2Round | |
|---|---|
| 键入 | static 参数 |
| 默认 | 0 |
| 范围 |
[0, BitWidth(I)-1](无符号) (BitWidth(I) - bits2Round > 1)(有符号) |
|
此参数定义输入向右移位的位数。 |
|
以下示例展示了运算符 RND 的用法:
-
A binarization example for local adaptive thresholding. A kernel size of 8 by 8 pixel is used.
-
“Bayer 3x3 Demosacing with White Balancing”
示例 - 该示例展示了使用 3x3 滤波器对 Bayer RAW 图案进行去马赛克(Demosaicing)处理。 此外,还添加了用于颜色校正的白平衡。
-
示例 - 该示例展示了使用 5x5 滤波器对 Bayer RAW 图案进行去马赛克处理。 此外,还添加了用于色彩校正的白平衡功能。


上一页

