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.
Let's have a look at an example. The following structuring element is given.
We will apply the operator to the following image I
The resulting output O is
Assume that the kernel was generated using operator FIRkernelNxM with parameter EdgeHandling = EdgeMirrored
StructElement | |
---|---|
Type | static parameter |
Default | -1 |
Range | {-1, 0, 1} |
This parameter defines the shape of the structuring element.
If the input kernel size of the operator is changed, the coefficients will also change. Check the coefficients after changing the input kernel size. |
The use of operator NumberOfHits is shown in the following examples:
-
'Functional Example for Specific Operators of Library Signal, Logic, Filter and Parameters'
Examples - Demonstration of how to use the operator