Operator NumberOfHits

Operator Library: Filter

The operator NumberOfHits counts the number of matches in the binary image of kernel size N x M in the input link I and in the matching matrix. The result is output at the link O. The matching matrix is defined using parameter StructElement. An entry of '1' in the StructElement indicates that the pixel must contain the value '1' in the kernel to be included in the counting. A value '0' in the structuring element indicates that the pixel must be value '0' to be included in the counting. An entry '-1' marks don't care kernel pixels. Such pixels will be ignored during counting.

例を見てみましょう。次のような構造化要素が与えられています。

以下の画像 I にオペレーターを適用します。

結果として得られる出力 O は以下のようになります。

パラメータ EdgeHandling = EdgeMirrored を指定して、オペレーター FIRkernelNxM を使用してカーネルが生成されたと仮定します。

I/O Property

Property 値
オペレータータイプ O
Input Link 私、カーネル入力
Output Link O, data output

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

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

1

出力の Bit Width は、入力カーネルサイズから以下の式によって自動的に決定されます。

パラメーター

StructElement
タイプ static パラメータ
Default -1
範囲 {-1, 0, 1}

このパラメータは、構造化要素の形状を定義します。

  • ヒット Counter をインクリメントするには、構造化要素内の「0」が、対応するカーネル入力内の「0」と一致している必要があります。

  • ヒット Counter をインクリメントするには、構造化要素内の「1」が、対応するカーネル入力内の「1」と一致している必要があります。

  • 構造化要素内の「-1」はその位置が不問であることを示し、無視されます。

オペレーターの入力カーネルサイズが変更されると、係数も変更されます。 入力カーネルサイズの変更後に係数を確認してください。

使用例

オペレーター NumberOfHits の使用例を以下に示します。