Operator RemovePixel

Operator Library: Synchronization

The operator RemovePixel removes pixels between the input link I and output link O in correspondence to the control input link Rem. The remove input link Rem is a binary input link which controls the removal of pixels. If a pixel at Rem is set to one, the pixel at the same position at input link I is removed. The following pixels are shifted left. Thus, the output lines are reduced in their width by the number of removed pixels.

Due to the removing of pixels it is possible to construct lines with a line width which is not divisible by the parallelism of the link.

To generate lines lengths at output link O that are divisible by the parallelism of the link, the operator inserts dummy pixels. The content of these dummy pixels is undefined (VA-simulation sets these value to 0).

You have two options for creating lines with a length divisible by the link parallelism:

You can make the operator either

  • fill the lines in question with dummy pixels until the line length is divisible by the link parallelism (see example 1), or
  • shift the pixels that don't make up a full block of parallel pixels to the next line (see example 2). In this case, the operator inserts dummy pixels only in the last line of the frame if necessary.

You control this behaviour of the operator by parameter FlushCondition: If the parameter is set to EoL (End of Line), the operator will add the dummy pixels to the end of the lines which are not divisible by the parallelism. The line structure of the image will be preserved, even if all pixels are removed from the image (the image than consists of only empty lines). If all pixels are removed in the frame, the frame will consist of empty lines only. The number of lines is not changed.

If parameter FlushCondition is set to EoF (End of Frame): If the last pixels of a line do not complete a block of parallel pixels, these last pixels are moved to the next output line. Thus, the lines end at parallelism boundaries and the exceeding pixels are moved to the following line. The operator will therefore only create dummy pixels at the end of the frame. The line structure may be changed in this mode and the last line may be longer (by 1 parallelism). Therefore, the MaxWidth is 1 times parallelism wider than the input link. The EoF mode is often used for image compression applications.

[Note] Resource Consumption

The operator's FGPA resource consumption strongly increases with the parallelism. Basler recommends to use low parallelism at this operator.

The parallelism can be reduced by shifting the parallel pixel into a kernel (i.e. by using CastKernel) before using the RemovePixel operator.

If you want to remove only the last pixels of a line, you can use the operator CutLine in the mode truncate instead. This saves resources.

-------------------------------------------------------------------------------------

Example 1 (parameter FlushCondition is set to EoL):

In this example, FlushCondition is set to EoL (default). The operator is used with a parallelism of 4 and gets the images as shown in the picture.

In the second line, two pixels are removed. This will cause the following pixels to be shifted. Since 6 (the new line length) is not dividable by 4 (parallelism), 2 dummy pixels are inserted. In the third line, 4 pixel are removed. Since 4 (the new line length) is dividable by 4, the line simply gets shorter and no dummy pixels are inserted. The 6th line is removed completely. For the following simulation it is treated as an empty line.

Example 1: Behavior if FlushCondition is set to EoL and parallelism is set to 4 (Rem is always 0, except for the pixels set to 1)

-------------------------------------------------------------------------------------

Example 2 (parameter FlushCondition is set to EoF):

In this example, FlushCondition is set to EoF. The operator is used with a parallelism of 4 and gets the images as shown in the picture.

Example 2: Behavior if FlushCondition is set to EoF and parallelism is set to 4 (Rem is always 0, except for the pixels set to 1)

[Caution] Changed Maximum Image Width in EoF Mode - Be attentive with Older Designs!

The maximum image width has been corrected for EoF mode to be 1 parallelism wider (for Parallelism > 1). Please look at the example to understand the issue. This might cause DRC errors in older designs.

If you know for sure that this extra width is not needed, you may use SetDimension to set the dimension back to the maximum input width.

I/O Properties

Property Value
Operator Type P
Input Links I, data input
Rem, control input
Output Link O, data output

Supported Link Format

Link Parameter Input Link I Input Link Rem Output Link O
Bit Width [1, 64]1 1 as I
Arithmetic {unsigned, signed} unsigned as I
Parallelism any as I as I
Kernel Columns any 1 as I
Kernel Rows any 1 as I
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} as I as I
Color Format any VAF_GRAY as I
Color Flavor any FL_NONE as I
Max. Img Width any as I as I (EoL mode) / as I + parallelism (EoF mode)
Max. Img Height any as I as I

1

The range of the input bit width is [1, 64] for unsigned inputs. For signed inputs, the range is [2, 64]. For unsigned color inputs, the range is [3, 63] and for signed color, the range is [6, 63].

Synchronous and Asynchronous Inputs

  • All inputs are synchronous to each other i.e. they have to be sourced by the same M-type operator through an arbitrary network of O-type operators.

Parameters

FlushCondition
Type static parameter
Default EoL
Range {EoL, EoF}

This parameter controls the insertion of dummy pixels. In EoL mode, dummy pixels will be inserted at the end of a line if the line length is not dividable by parallelism.

In EoF mode, if the last pixels of a line do not complete a block of parallel pixels, these pixels are moved to the next output line. Thus, the lines end at parallelism boundaries and the exceeding pixels are moved to the following line. The operator will therefore only create dummy pixels at the end of the frame if the last line of the frame is not dividable by the parallelism. The MaxWidth of the frame at the output link O is the frame width at the Input-Link + 1 parallelism.

The parameter is deactivated if image protocol VALT_PIXEL0D is used. For the image protocol VALT_LINE1D, only EoL can be used.

Examples of Use

The use of operator RemovePixel is shown in the following examples: