Documentation

Erode an image by a given mask. More...

## Modules

erode
The C++ interface for erode.

af_erode
The C interface for erode.

## Detailed Description

Erode an image by a given mask.

The erosion function is a morphological transformation on an image that requires two inputs. The first is the image to be morphed, and the second is the mask indicating neighborhood that must be white in order to preserve each pixel.

In erode, for each pixel, the mask is centered at the pixel. If each pixel of the mask matches the corresponding pixel on the image, then no change is made. If there is at least one mismatch, then pixels are changed to the background color (black).

Erosion supports n-channel images (ie. 3D matrices). However a tile must be 2D and will be same for all channels. If you wish to use separate masks for channels, you can extract the channel, apply the operation and store the resulting channel back in the array.

Image erosion is useful for making edges more defined.

// Erode an image, 8-neighbor connectivity