Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Name: Aditya Singh Roll No: 63

Class: D14 Branch: EXTC Division: B

Subject: Digital Image Processing and Machine Vision

Experiment No: 6

Title of the Experiment: Morphological Operations

Date of performance: 08/03/2022

Date of Submission/correction: 15/03/2022

Grade/Marks:

Signature:
Aim : To perform the following operations :
1) Erosion
2) Dilation
3) Opening
4) Closing
5) Border Extraction
Create a GUI for displaying the result.

Tool/Software : Visual Studio Code

Programming Language : Python

Theory :

Erosion :

Erosion erodes away the boundaries of the foreground object and is used to diminish
the features of an image.

Working of erosion:

• A kernel is convolved with the image.


• A pixel in the original image (either 1 or 0) will be considered 1 only if all the
pixels under the kernel are 1, otherwise, it is eroded (made to zero).
• Thus, all the pixels near the boundary will be discarded depending upon the
size of the kernel.
• So, the thickness or size of the foreground object decreases or simply the
white region decreases in the image.
Dilation :

Dilation increases the object area and is used to accentuate features.

Working of dilation:

• A kernel is convolved with the image.


• A pixel element in the original image is ‘1’ if at least one pixel under the kernel
is ‘1’.
• It increases the white region in the image or the size of the foreground object
increases.

Opening :

Opening is a process in which first erosion operation is performed and then dilation
operation is performed. It eliminates the thin protrusions of the obtained image.
Opening is used for removing internal noise of the obtained image.

Closing :

Closing is a process in which first dilation operation is performed and then erosion
operation is performed. It eliminates the small holes from the obtained image.
Closing is used for smoothening of contour and fusing of narrow breaks .
Border Extraction :

For border extraction, we take the erosion of the image and subtract the eroded
image from the original image to obtain the border.

Observations :
Conclusion :

• Morphological operations are a set of operations that process images based


on shapes. They apply a structuring element to an input image and generate
an output image.

• Erosion removes the small anomalies by removing the objects smaller than
the structuring element.

• Dilation fills the holes and broken areas by connecting the areas that are
separated by space smaller than the structuring element.

• Opening is used for removing internal noise of the obtained image.

• Closing is used for smoothening of contour and fusing of narrow breaks.

You might also like