0% found this document useful (0 votes)
123 views

(4.a) Morphological Operations

This document provides an introduction to morphological operators in image processing. It discusses how morphological operations can be used to remove imperfections in segmented images and provide structural information. The key morphological operations of erosion and dilation are described through examples. Erosion shrinks objects and removes noise, while dilation enlarges objects and fills holes. More complex operations like opening and closing are also introduced, which combine erosion and dilation using the same structuring element. Opening can be used to separate touching objects, while closing removes holes and smoothes contours. Overall, morphological operators are useful image processing tools based on simple pattern matching with structuring elements.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views

(4.a) Morphological Operations

This document provides an introduction to morphological operators in image processing. It discusses how morphological operations can be used to remove imperfections in segmented images and provide structural information. The key morphological operations of erosion and dilation are described through examples. Erosion shrinks objects and removes noise, while dilation enlarges objects and fills holes. More complex operations like opening and closing are also introduced, which combine erosion and dilation using the same structuring element. Opening can be used to separate touching objects, while closing removes holes and smoothes contours. Overall, morphological operators are useful image processing tools based on simple pattern matching with structuring elements.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

Introduction to

Morphological Operators
ANISHA M. LAL
• Once segmentation is complete, morphological operations can be used to
remove imperfections in the segmented image and provide information on
the form and structure of the image
Morphology
• Morphological image processing (or morphology) describes a range of image
processing techniques that deal with the shape (or morphology) of features
in an image
• Morphological operations are typically applied to remove imperfections
introduced during segmentation, and so typically operate on bi-level images
Example

Image after segmentation Image after segmentation and


morphological processing
Structuring Elements, Hits & Fits

B Structuring Element

Fit: All on pixels in the structuring


element cover on pixels in the image
Hit: Any on pixel in the structuring
A element covers an on pixel in the
C image

All morphological processing operations are based on these simple ideas


Structuring Elements
Structuring elements can be any size and make any shape
However, for simplicity we will use rectangular structuring elements with their
origin at the middle pixel
0 0 1 0 0
0 1 1 1 0
1 1 1 0 1 0
1 1 1 1 1
1 1 1 1 1 1 0 1 1 1 0
1 1 1 0 1 0 0 0 1 0 0
Fundamental Operations
Fundamentally morphological image processing is very like 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 operation performed
There are two basic morphological operations: erosion and dilation
EROSION
• Introduction to Morphological Operators
• Used generally on binary images, e.g., background subtraction results!
• Used on gray value images, if viewed as a stack to binary images.
• Good for, e.g.,
• Noise removal in background
• Removal of holes in foreground / background
A first Example: Erosion
• Erosion is an important morphological operation

• Applied Structuring Element:


Example for Erosion
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0
Example for Erosion
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0
Example for Erosion
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0
Example for Erosion
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0
Example for Erosion
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0 1
Example for Erosion
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0 1 0
Example for Erosion
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0 1 0 0
Example for Erosion
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 0 0 0 0 1 0 0 0
Dilation & Erosion
• Basic operations
• Are dual to each other:
• Erosion shrinks foreground, enlarges Background

• Dilation enlarges foreground, shrinks background


Erosion
• Erosion is the set of all points in the image, where the structuring element
“fits into”.
• Consider each foreground pixel in the input image
• If the structuring element fits in, write a “1” at the origin of the structuring element!
• Simple application of pattern matching
• Input:
• Binary Image (Gray value)
• Structuring Element, containing only 1s!
What Is Erosion For?
Erosion can split apart joined objects

Erosion can strip away extrusions

Watch out: Erosion shrinks objects


Another example of erosion

• White = 0, black = 1, dual property, image as a result of erosion gets


darker
Counting Coins
• Counting coins is difficult because they touch each other!
• Solution: Binarization and Erosion separates them!
DILATION
Example: Dilation
• Dilation is an important morphological operation

• Applied Structuring Element:


Dilation
• Dilation is the set of all points in the image, where the structuring element
“touches” the foreground.
• Consider each pixel in the input image
• If the structuring element touches the foreground image, write a “1” at the origin of
the structuring element!
• Input:
• Binary Image
• Structuring Element, containing only 1s!!
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 0
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 0 1
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 0 1 1
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 0 1 1 1
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 0 1 1 1 1
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 0 1 1 1 1 1
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1

Structuring Element 1 1 1

Output Image 1 0 1 1 1 1 1 1
Another Dilation Example

• Image get lighter, more uniform intensity


What Is Dilation For?
Dilation can repair breaks

Dilation can repair intrusions

Watch out: Dilation enlarges objects


Opening & Closing
• Important operations
• Derived from the fundamental operations
• Dilation
• Erosion
• Usually applied to binary images, but gray value images are also possible
• Opening and closing are dual operations
OPENING
Opening
• Similar to Erosion
• Spot and noise removal
• Less destructive
• Erosion next dilation
• the same structuring element for both operations.
• Input:
• Binary Image
• Structuring Element, containing only 1s!
Opening
• Take the structuring element (SE) and slide it around inside each foreground
region.
• All pixels which can be covered by the SE with the SE being entirely within the
foreground region will be preserved.
• All foreground pixels which can not be reached by the structuring element without
lapping over the edge of the foreground object will be eroded away!
• Opening is idempotent: Repeated application has no further effects!
Opening
• Structuring element: 3x3 square
Use Opening for Separating Blobs
• Use large structuring element that fits into the big blobs
• Structuring Element: 11 pixel disc
CLOSING
Closing
• Similar to Dilation
• Removal of holes
• Tends to enlarge regions, shrink background
• Closing is defined as a Dilation, followed by an Erosion using the same structuring
element for both operations.
• Dilation next erosion!
• Input:
• Binary Image
• Structuring Element, containing only 1s!
Closing
• Take the structuring element (SE) and slide it around outside each foreground
region.
• All background pixels which can be covered by the SE with the SE being entirely within
the background region will be preserved.
• All background pixels which can not be reached by the structuring element without
lapping over the edge of the foreground object will be turned into a foreground.
• Opening is idempotent: Repeated application has no further effects!
Closing
• Structuring element: 3x3 square
Closing Example 1
1. Threshold
2. Closing with disc of size 20

Thresholded closed
Closing Example 2
• Good for further processing: E.g. Skeleton operation looks
better for closed image!

skeleton of skeleton of Thresholded


Thresholded and next closed

You might also like