Operator RND

Operator Library: Arithmetics

Operator RND は、丸め処理とクリッピングを行って出力 Bit Width へ右シフトを実行します。 丸めるビット数は、パラメータ bits2Round で指定します。

実装されている丸め方法は、四捨五入(正確にはゼロから離れる方向への丸め)です。カラーコンポーネントは個別に丸められます。

例

  • Input = 4 Bit unsigned, Input Value = 7, bits2Round = 2

    Output = 2 Bit unsigned, Output Value = 2

  • Input = 5 Bit signed, Input Value = -13, bits2Round = 2

    Output = 3 Bit signed, Output Value = -3

  • Input = 4 Bit unsigned, Input Value = 15, bits2Round = 2

    Output = 2 Bit unsigned, Output Value = 3 注: 出力は表現可能な最大値にクリッピングされています。

I/O Property

Property 値
オペレータータイプ O
Input Link I, data input
Output Link O, data output

サポートされているリンクフォーマット

Link Parameter Input Link I Output Link O
Bit Width [1, 64] unsigned、[2, 64] signed auto1
Arithmetic {unsigned, signed} as I
Parallelism any as I
Kernel Columns any as I
Kernel Rows any as I
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} as I
Color Format any as I
Color Flavor any as I
Max. Img Width any as I
Max. Img Height any as I

1

出力の Bit Width は、入力の Bit Width からパラメータ bits2Round の値を引いたものになります。

パラメーター

bits2Round
タイプ static パラメータ
Default 0
範囲

[0, BitWidth(I)-1](符号なしの場合)

(BitWidth(I) - bits2Round > 1)(符号付きの場合)

このパラメータは、入力を右にシフトするビット数を定義します。

使用例

Operator RND の使用例を以下に示します。

  • 'Adaptive Threshold'

    ローカルのアダプティブしきい値処理の二値化の例。 8×8ピクセルのカーネルサイズを使用します。

  • 'Bayer 3x3 Demosacing with White Balancing'

    例 - この例では、3x3 フィルターを使用した Bayer RAW パターンのデモザイク処理を示しています。 さらに、色補正のためのホワイトバランス調整が追加されています。

  • 'Bayer 5x5 Demosacing with White Balancing'

    例 - この例は、5x5フィルターを使用したBayer RAWパターンのデモザイキングを示しています。 さらに、カラー補正のためのホワイトバランスが追加されています。