Operator Library: Accumulator
The ModuloCounter counts the number of pixels, lines or frames at the input link. Its count sequence is restricted by the modulo divisor. The number of unique states that a counter may have before the sequence repeats itself is defined by the modulo divisor. The modulo divisor is defined with the Divisor parameter. For example, a modulo divisor of 4 will count "n MOD 4" i.e. 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3 ...
The image dimensions of the output frames are always equal to the image dimensions of the input frames. The pixel data at the output represent the counter result. Note that no pixel values are used. Only the pixel, line or frame index is considered for calculation.
The counter always starts from value zero. The CountEntity parameter can be configured to either count every pixel, line or frame of the input link. For example, if parameter CountEntity is set to PIXEL, the operator will increment its counter with every pixel of the input.
If CountEntity is set to LINE, the counter increments at the beginning of every line and hence, counts the lines of the input link. For example a modulo divisor of four will have the result that all pixels of line zero have value 0. The pixels of line one will have value one, etc. However, the pixels of line 4 will have the pixel values zero again.
If CountEntity is set to FRAME, the counter increments at the beginning of every frame.
In the following examples the operator's usage is illustrated. First example shows two successive frames which have an image width and image height of eight pixels. All pixel values are illustrated as numbers. Frame index 0 represents the initial frame, i.e. the first frame after acquisition start.
-
Configuration: Divisor = 6, CountEntity = PIXEL, AutoClear = EoF
As can be seen in this example, the counter is incremented with every pixel when parameter CountEntity is set to PIXEL. The result values are in the range from zero to five, as the Divisor is set to six. In the second frame the operator starts from zero again, as the counter is reset at the end of the frame.
-
Configuration: Divisor = 6, CountEntity = LINE, AutoClear = NONE
In this example, the operator counts lines instead of pixels. Thus, every pixel of the image represents the line number. Here, parameter AutoClear is set to NONE. Therefore, the operator continues counting lines in the second frame without a reset at the first image line.
-
Configuration: Divisor = 6, CountEntity = FRAME, AutoClear = NONE
The last example shows the counting of frames. Here, the value of every pixel represents the frame number.
If the parameter divisor is changed during acquisition, the new value is applied with the start of the next frame. For 1D input, the new value is applied for the next line. If 0D data is at the input, a new divisor value is applied immediately.
Image Restrictions
-
Empty Images
Empty images, i.e., images with no pixels, are not allowed.
Divisor | |
---|---|
Type | static/dynamic write parameter |
Default | 1 |
Range | [1..2^OutputBitWidth] |
This parameter defines the divisor of the modul operation. The divisor value has to be less equal than 2^OutputBitwidth. |
CountEntity | |
---|---|
Type | static parameter |
Default | PIXEL |
Range | {PIXEL, LINE, FRAME} |
This parameter defines whether the operator counter is enabled for every pixel, every line or it is enabled once for each frame only. Option FRAME is only available for image protocol VALT_IMAGE2D. LINE is only available for image protocols VALD_IMAGE2D and VALT_LINE1D. For image protocol VALT_PIXEL0D the parameter will always count pixel. |
AutoClear | |
---|---|
Type | static parameter |
Default | NONE |
Range | {EoL, EoF, NONE} |
The AutoClear option allows a reset of the counter to zero at either the end of a line, the end of a frame or no clear at all is performed. If CountEntity is set to PIXEL, all three options of this parameter can be selected. If CountEntity is set to LINE options EoF and NONE are available. For CountEntity FRAME, an auto clear of the operator is not possible. If the VALT_LINE1D image protocol is used, no clear at the end of a frame is possible. In VALT_PIXEL0D, no auto clear of the operator is available. |
The use of operator ModuloCount is shown in the following examples:
-
' Multiple DMA Channel Designs '
Remove 9 out of 10 images.
-
Examples - Shows the usage of operator Blob_Analysis_1D in line scan applications.
-
'Color Plane Separation Option 3 - Sequential with Operator ImageBufferMultiRoI'
Sequential DMA output of the color planes. The color separations is performed using operator ImageBufferMultiROI.
-
'Color Plane Separation Option 5 - Sequential Output with Advances Processing'
Example on separation of color planes. The RGB input is split into its component and sequentially output via one DMA channel. The splitting if performed by collecting same components in parallel words and reading with FrameBufferRandomRead.
-
Example - For debugging purposes the Scope operator provides options for analyzing gray-scale pictures. .
-
Examples - Downsampling by factor 3x3 without the use of operator SampleDn.
-
Examples - A grid is overlayed to the input images. The grid pixel value is determined from the input pixel value.