Operator ERODE

Operator Library: Filter

The ERODE operator performs a binary erosion of the image, which can be used to separate touching objects. The input of the operator is a kernel image data stream. At the output the erosion result of the central pixel is provided. A structuring element for the erode operation is given by a parameterizable binary matrix StructElement. The matrix has the size of the input kernel. Erosion is a fundamental operation in morphological image processing. In erosion, the output is set to '1', if all matrix elements with a value of '1' match their corresponding elements in the kernel. A matrix element with a value of '0' is treated as don't care and is ignored. In other words, the kernel matrix must fully fit into the image. If all matrix elements have a value of '0', the behavior depends on the setting of the StructElement parameter:

  • Static: The result is always '0'.

  • Dynamic: The result is always '1'.

I/O Properties

Property Value
Operator Type O
Input Link I, kernel input
Output Link O, result output

Supported Link Format

Link Parameter Input Link I Output Link O
Bit Width 1 as I
Arithmetic unsigned as I
Parallelism any as I
Kernel Columns any as I
Kernel Rows any as I
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

Parameters

StructElement
Type static/dynamic read/write parameter
Default 1
Range {0, 1}

A structuring element is a defined shape used to probe or interact with an image in order to determine how well this shape matches or differs from the shapes present in the image.

  • A value of '0' in the StructElement parameter means that the position is treated as don't care and is ignored.

  • A value of '1' in the StructElement parameter must correspond to a '1' at the same position in the kernel input.

If the input kernel size of the operator is changed, the coefficients will also change. Therefore, check the coefficients after changing the input kernel size.

If the parameter is set to Static, the values are selected at design time. If the parameter is set to Dynamic, it is possible to change the values during runtime. Changes made during runtime take effect immediately; they are not synchronized at the end of a frame or at the end of a line.

Examples of Use

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

  • 'Morphological Edge'

    Examples - A binary eroded image is compared with the original. An edge is detected if both differ.

  • 'Close'

    Examples - Shows the implementation of a morphological close applied to binary images.

  • 'Open'

    Examples - Shows the implementation of a morphological open applied to binary images.