# Erosion And Dilation [Mathematical Morphology]

## Classes

class  SoDilationBallProcessing3d
SoDilationBallProcessing3d engine More...
class  SoDilationCubeProcessing
SoDilationCubeProcessing engine More...
class  SoDilationDiskProcessing2d
SoDilationDiskProcessing2d engine More...
class  SoDilationDiskProcessing3d
SoDilationDiskProcessing3d engine More...
class  SoDilationLineProcessing2d
SoDilationLineProcessing2d engine More...
class  SoDilationLineProcessing3d
SoDilationLineProcessing3d engine More...
class  SoDilationSquareColorProcessing2d
SoDilationSquareColorProcessing2d engine More...
class  SoErosionBallProcessing3d
SoErosionBallProcessing3d engine More...
class  SoErosionCubeProcessing
SoErosionCubeProcessing engine More...
class  SoErosionDiskProcessing2d
SoErosionDiskProcessing2d engine More...
class  SoErosionDiskProcessing3d
SoErosionDiskProcessing3d engine More...
class  SoErosionLineProcessing2d
SoErosionLineProcessing2d engine More...
class  SoErosionLineProcessing3d
SoErosionLineProcessing3d engine More...
class  SoErosionSquareColorProcessing2d
SoErosionSquareColorProcessing2d engine More...

## Introduction to Erosion

In an erosion, pixel values within the structuring element are set to the minimum value of the element. In a binary image, an erosion removes isolated points and small particles, shrinks other particles, discards peaks at the object boundaries, and disconnects some particles.

Erosion modules are reiterative: repeating an erosion or dilation of size 1 N times has the same effect as performing a single erosion with a structuring element of size N.

In Figure 4 the binary image is I, and X denotes the set of points with a value of 1. The erosion of I by the structuring element B results in the set of points x, where the disk representing B and cenetred on x is totally included in the set of points X. The erosion of I can be denoted as or .

Figure 4: Erosion applied to a binary image

The eroded set of X by the structuring element B is:

It may also be written as:

The value of the structuring element (B) varies depending on the type of erosion. On a gray level image, the erosion by the structuring element B is the search for the minimal value of intensities within B.

• 2D image : .
• 3D image : .

When the point hits the edge of the image, the structuring element is composed of the intersection of B with the points of the structuring element totally within the image, and not the points outside the image.

## Introduction to Dilation

In a dilation, pixel values within the disc are set to the maximum value of the pixel neighborhood. In a binary image, a dilation fills the small holes inside particles and gulfs at the object boundaries, enlarges the size of the particles and may connect neighboring particles.

Dilation modules are reiterative: repeating an erosion or dilation of size 1 N times has the same effect as performing a single erosion with a structuring element of size N.

In Figure 5, the binary image is I, and X denotes the set of points with a value of 1. The dilation of I by the structuring element B results in the set of points x, where the disc representing B and centered on x has a non empty intersection with the set of points X. The dilation of I can be denoted as or .

Figure 5: Dilation applied to a binary image

The dilated set of X by the structuring element B is:

It may also be expressed as:

The value of the structuring element (B) varies depending on the type of erosion. On a gray level image, the dilation by the structuring element B is the search for the maximum value of intensities within B:

• 2D image : .
• 3D image : .

When the point hits the edge of the image, the structuring element is composed of the intersection of B with the points of the structuring element totally within the image, and not the points outside the image.

Open Inventor Toolkit reference manual, generated on 16 Jul 2020