# Morphology - Why does the concept of opening and closing images exist when we already have erosion and dilation?

If we consider the closing operation of an image, we first dilate the image and then erode it. So, first we expand the foreground (white pixels) and and then we take away some part of the foreground. The result of this particular operation is similar to dilation, but less destructive of the original shape boundary.

However, we can combine erosion and dilation in different ways to control the extent of increase or decrease of the shape boundary. Then, why do we specifically define closing and opening operations?

As you said closing is completely defined by a dilatation followed by an erosion with the same structuring element (SE) (respectively opening is an erosion followed by a dilation with the same structuring element).

The key point is that is must be the same structuring element and this is much more specific than an erosion followed by a dilatation with different random SE.

Closing and opening operations are defined just for convenience, because giving an image and a SE the result can easily be predicted and interpreted by the user.

The result of this particular operation is similar to dilation [...]

Not really, dilatation is more like a thickening operation while closing fills holes and smooth borders accordingly to the SE (opening with a disk rounds angular borders for instance).

Try erosion, dilatation, opening and closing on simple shapes (square, disk, triangle, hollow shapes, set of close shapes) with simple SE (share, disk, lines) to better visualize the effect of each of them. you can also try erosion followed by dilatation with different SE to see the difference with an opening.

To sum up opening and closing are defined for convenience only, as it is a specific case of erosion and dilatation composition that have noteworthy properties.

• Isn't closing the one that fills holes? Aug 6, 2018 at 9:31
• Yes it is, I corrected my answer Aug 6, 2018 at 9:43