Loadable Function: imerode (im, SE)
Loadable Function: imerode (im, SE, shape)

Perform morphological erosion.

The image im must be a numeric matrix with any number of dimensions. The erosion is performed with the structuring element se which can be a:

  • strel object;
  • array of strel objects as returned by @strel/getsequence;
  • matrix of 0’s and 1’s.

To perform a non-flat erosion, SE must be a strel object.

The size of the result is determined by the optional shape argument which takes the following values:

"same" (default)

Return image of the same size as input im.

"full"

Return the full erosion (image is padded to accommodate se near the borders).

"valid"

Return only the parts which do not include the padded edges.

In case of a SE with a size of even length, the center is considered at indices floor ([size(SE)/2] + 1).

See also: imdilate, imopen, imclose, strel.

Package: image