Operator Library: Base
The operator ImageNumber provides the index of the current image of the input link at the output link. Thus, each pixel at the input is replaced by the index of the image i.e. the image number. The actual input pixel values are not used. The operator works as a counter which is incremented with every new image at its input. The counter is reset on the start of the process ('Multiple Processes') or after it reached it's maximum. The first image will have image index 0.
The counter width can be defined by changing the bit width of the output link O. If the counter reached it's maximum it will start from zero again = wrap around condition. For example, an output bit width of 8 bit will result in counter values between zero to 255.
Using parameter SingleShot, the operator will not be reset on the wrap around condition. The counter value output will remain at the maximum value. Thus, for an 8 bit image counter the counter value will remain at it's maximum of 255.
Often this operator is used in conjunction with operator RemoveImage to remove the first N images of a sequence.
Operator Restrictions
- The operator supports empty images. The operator will count those empty images. However, for the empty images, the counter value cannot be provided at the output as the output of an empty frame contains no pixel. After the next non-empty image the output link will provide the correct counter value.
SingleShot | |
---|---|
Type | static parameter |
Default | OFF |
Range | {OFF, ON} |
This parameter controls the wrap around condition. When set to OFF the counter will count infinitely with each processed image, i.e. a wrap around will occur at maximum possible counter value defined by the output link bit width. When set to ON, the counter keeps counting until the maximal possible value is reached. The counter will stop counting at it's maximum value. |
The use of operator ImageNumber is shown in the following examples:
-
Example - Histogram thresholding
-
Example - While image timing is provided by a generator the designs data flow can be analyzed.
-
Example - For debugging purposes images can be inserted manually.
-
Example - For debugging purposes image transfer states on links can be investigated.
-
Example - For debugging purposes the Scope operator provides options for analyzing gray-scale pictures. .
-
Examples - Calculates the differences between two successive images. The differences are thresholded and output via DMA channel.
-
'A rolling average is applied on a dynamic number of images'
Examples - Rolling Average - Loop