

Choosing the best size for the structuring element is often a compromise between noise removal and preservation of structure shape. For example, the result of morphological closing on the figure above creates artificial connections between grains. Note that even if opening and closing better preserve the size of the structures in the original image, the shape is slightly altered. From left to right: morphological closing, and morphological opening. Some examples of composed morphological filters. In a symmetric way, the result of an erosion followed by a dilation is called a morphological opening, and removes bright structures smaller than the structuring element. It can also connect bright structures that were separated by a thin dark space. For example, the result of a dilation followed by an erosion is called a morphological closing, and removes dark structures smaller than the structuring element. Morphological dilation and erosion are often used in combination. Morphological erosion can also be used on binary images to help separating touching particles. Applying a dilation or an erosion changes the size of the structures in the image: the grains in the result of the dilated image are larger. From left to right: original image, result of dilation with a square structuring element, and result of erosion with the same structuring element. Some examples of morphological filters on a grey level image. In that case, the morphological dilation computes for each pixel the maximum within its neighborhood (defined by the structuring element), whereas the morphological erosion considers the minimum value within the neighborhood. Morphological erosion and dilation may also be applied on grayscale images.

Grayscale morphological filters Grayscale erosion and dilation After an erosion, components may disappear, or components be separated into several parts. It may also change its topology: after a dilation, components may merge and holes be filled. Morphological dilation and erosion change the size and the resulting set. Principle of morphological dilation and erosion on a binary set, using a disk-shaped structuring element. It results in a set smaller than original set. The principle of morphological erosion is to test for each point of the plane if the structuring element centred on this point is contained within the original set.

It results in a set larger than the original set. The principle of morphological dilation is to test for each point of the plane, if the structuring element centered on this point intersects the structure of interest (see figure below). The most basic morphological filters are the morphological dilation and the morphological erosion. The original idea was to define a methodology to describe shapes by using another shape as test probe (Serra, 1982 1). Linear structuring element of various orientations may also be used to assess local orientation of the structures. Common structuring element include squares, discrete disks and octogons. Morphological filters are defined according to a structuring element of a given size and shape. They are local filters, in the sense that they consider the neighborhood of each pixel/voxel.

Morphological filters are very common filters that can be combined together to provide a large variety of solutions.
