Understanding Morphological Image Processing and
Its Operations
This article illustrates Morphological Image Processing in more straightforward terms; readers
can understand how Morphology works in Digital Image Processing
Boundary Extraction using Morphological Image Processing operations.
The word ‘Morphology’ generally represents a branch of biology that deals with the form and
structure of animals and plants. However, we use the same term in ‘mathematical morphology’ to
extract image components useful in representing region shape, boundaries, etc.
Morphology is a comprehensive set of image processing operations that process images based on
shapes [1]. Morphological operations apply a structuring element to an input image, creating an
output image of the same size. In a morphological operation, the value of each pixel in the output
image is based on a comparison of the corresponding pixel in the input image with its neighbors.
There is a slight overlap between Morphology and Image Segmentation. Morphology consists of
methods that can be used to pre-process the input data of Image Segmentation or to post-process
the output of the Image Segmentation stage. In other words, once the segmentation is complete,
morphological operations can be used to remove imperfections in the segmented image and
deliver information on the shape and structure of the image as shown in Figure 2.
Figure 2. Example of Morphological Processing [2]
This article focuses majorly on binary images, just for simplicity and
understanding.
Terminologies in Morphological Image Processing
All morphological processing operations are based on mentioned terms.
Structuring Element: It is a matrix or a small-sized template that is used to traverse an image.
The structuring element is positioned at all possible locations in the image, and it is compared
with the connected pixels. It can be of any shape.
Fit: When all the pixels in the structuring element cover the pixels of the object, we call it Fit.
Hit: When at least one of the pixels in the structuring element cover the pixels of the object, we
call it Hit.
Miss: When no pixel in the structuring element cover the pixels of the object, we call it miss.
Figure 3 shows the visualization of terminologies used in morphological image processing.
Figure 3. Morphology terminologies explained
Morphological Operations
Fundamentally morphological image processing is similar to spatial filtering. The structuring
element is moved across every pixel in the original image to give a pixel in a new processed
image. The value of this new pixel depends on the morphological operation performed. The two
most widely used operations are Erosion and Dilation.
1. Erosion
Erosion shrinks the image pixels, or erosion removes pixels on object boundaries.
First, we traverse the structuring element over the image object to perform an erosion operation,
as shown in Figure 4. The output pixel values are calculated using the following equation.
Pixel (output) = 1 {if FIT}
Pixel (output) = 0 {otherwise}
Figure 4. Erosion operation on an input image using a structuring element
An example of Erosion is shown in Figure 5. Figure 5(a) represents original image, 5(b) and 5(c)
shows processed images after erosion using 3x3 and 5x5 structuring elements respectively.
Figure 5. Results of structuring element size in erosion.
Properties:
1. It can split apart joint objects (Figure 6).
2. It can strip away extrusions (Figure 6).
Figure 6. Example use-cases of Erosion.
2. Dilation
Dilation expands the image pixels, or it adds pixels on object boundaries. First, we
traverse the structuring element over the image object to perform an dilation operation, as shown
in Figure 7. The output pixel values are calculated using the following equation.
Pixel (output) = 1 {if HIT}
Pixel (output) = 0 {otherwise}
Figure 7. Dilation operation on an input image using a structuring element.
An example of Dilation is shown in Figure 8. Figure 8(a) represents original image, 8(b) and 8(c)
shows processed images after dilation using 3x3 and 5x5 structuring elements respectively.
Figure 8. Results of structuring element size in dilation.
Properties:
1. It can repair breaks (Figure 9).
2. It can repair intrusions (Figure 9).
Figure 9. Example use-cases of DIlation
Compound Operations
Most morphological operations are not performed using either dilation or erosion; instead, they
are performed by using both. Two most widely used compound operations are: (a) Closing (by
first performing dilation and then erosion), and (b) Opening (by first performing erosion and then
dilation). Figure 10 shows both compound operations on a single object.
Figure 10. Output of Compound operations on an input object
Application: Edge Extraction of an Object
Extracting the boundary is an important process to gain information and understand the feature of
an image. It is the first process in preprocessing to present the image’s characteristics. This
process can help the researcher to acquire data from the image. We can perform boundary
extraction of an object by following the below steps.
Step 1. Create an image (E) by erosion process; this will shrink the image slightly. The kernel size
of the structuring element can be varied accordingly.
Step 2. Subtract image E from the original image. By performing this step, we get the boundary
of our object.
Segmentation By Morphological Watersheds
The aim of Segmentation is to separate regions wrt brightness, color, reflectivity, texture, etc.
Segmentation based on three principal concepts:
(a) detection of discontinuities,
(b) thresholding, and (c) region processing.
Basic Concepts
The concept of watersheds is based on visualizing an image in three dimensions: two spatial
coordinates versus gray levels. In such a "topographic" interpretation, we consider three types
of points:
a. Points belonging to a regional minimum
b. Catchment basin / watershed of a regional minimum Points at which a drop of water will
certainly fall to a single minimum
c. Divide lines / Watershed lines Points at which a drop of water will be equally likely to fall to
more than one minimum.
Crest lines on the topographic surface This technique is to identify all the third type of points for
Segmentation
1. Piercing holes in each regional minimum of .
2. The 3D topography is flooded from below gradually
3. When the rising water in distinct catchment basins is about to merge, a dam is built to prevent
the merging
4. The dam boundaries correspond to the watershed lines to be extracted by a Watershed
segmentation algorithm.