You are on page 1of 24

Morphological Operations

Sarangi Oza
IT Dept.,
Definition
• Morphology is a broad set of image processing operations
that process images based on shapes.

• Morphological image processing is a collection of non-


linear operations related to the shape or morphology of
features in an image.
• A morphological operation on a binary image creates a new
binary image in which the pixel has a non-zero value only if the
test is successful at that location in the input image.
Types of Operations
• Erosion
• Dilation
• Closing
• Opening
• Hit or Mass Transform
• Thinning
• Skeletonization
Structuring element
• Number of pixels added or removed from the objects in an image
depends on the size and shape of the structuring element used to
process an image.
Dilation
• The designated structuring element is used to probe and expand the
shapes in the input image.
• In particular, it functions as a local maximum filter. Dilation has the
inverse effect of erosion.
• It adds a pixel layer to the inner and outer boundaries of regions.
That is, the value of the output pixel is equal to the sum of the values
of all pixels in the neighborhood.
• It is also useful in joining broken parts of an object.
Contd.
Contd.
Contd.
Erosion
• This is directly opposite to dilation. The designated structuring
element is used to probe and reduce the shapes in the input image. In
particular, it functions as a local minimum filter.
• The structuring elements reduce the size of an image by removing a
layer of pixels from both the inner and outer boundaries of regions.
• Eliminates holes and gaps between different regions by using
erosion, as well as small details. In other words, the value of the
output pixel is the smallest of all pixels in the neighborhood.
• Erodes away the boundaries of foreground object
Erosion
Contd.
Contd.
Opening
• Opening is just another name of erosion followed by dilation. It is
useful in removing noise.
• Any narrow connections and lines between two regions are removed
by opening.
• Erodes an image and then dilates the eroded image, both with the
same structuring element. The morphological opening can be used to
remove small objects from an image while keeping the shape and size
of larger objects in the image.
Contd.
Contd.
Closing
• Closing is reverse of Opening, Dilation followed by Erosion. It is
useful in closing small holes inside the foreground objects, or small
black points on the object.

• Useful for filling small gaps in an image while maintaining the shape
and size of the objects in the image.
Contd.
Contd.
Hit and Miss transform
• The structuring element used in the hit-and-miss is a slight extension
to the type that has been introduced for erosion and dilation, in that
it can contain both foreground and background pixels
Contd.
• The hit-and-miss transform has many applications in more complex
morphological operations. It is being used to construct
the thinning and thickening operators
Thinning
Skeleton
Contd.
Contd.

You might also like