This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Erosion

Erosion[image, ker]
gives the morphological erosion of image with respect to the structuring element ker.
Erosion[image, r]
gives the erosion with respect to a range-r square.
  • Erosion works with binary, grayscale and other images.
  • The structuring element ker is a matrix containing 0s and 1s.
  • Erosion automatically adds zeros to structuring elements so that they have odd dimensions.
  • If multiple image channels are present, Erosion operates on each of them separately.
  • Erosion takes a Padding option that specifies the values to assume for pixels outside the image.
  • The default setting is Padding->1, corresponding to pixel value 1 for all channels.
  • Erosion[image, ker] interprets the structuring element so that Erosion[image, {{0, 0, 1}}] translates the image to the left.
Erosion reduces smaller light features:
Erosion of a grayscale image, using a disk-shaped structuring element:
Erosion of a grayscale photo:
Erosion operates on each color channel independently:
Erosion reduces smaller light features:
In[1]:=
Click for copyable input
Out[1]=
 
Erosion of a grayscale image, using a disk-shaped structuring element:
In[1]:=
Click for copyable input
Out[1]=
 
Erosion of a grayscale photo:
In[1]:=
Click for copyable input
Out[1]=
 
Erosion operates on each color channel independently:
In[1]:=
Click for copyable input
Out[1]=
Structuring elements are padded to odd dimensions, which can create artefacts at the right and bottom boundaries:
New in 7