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

7 - Morphological Image Processing

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)
12 views

7 - Morphological Image Processing

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/ 49

Morphological

Image Processing
Morphological image processing

• Morphology:
A branch of biology that deals with the form and structure of
animals and plants

• Mathematical morphology:
A tool for extracting image components that are useful to
describe region shape, such as boundaries, skeletons and convex hull.
Morphological image processing

• Morphological processing: filtering, thinning and pruning


• Input is image → output is image attributes

• Language of morphology – set theory


• Binary images whose components are elements of Z2 while in gray
scale image elements belongs to Z3
Preliminaries
Morphological image processing

• Reflection of a set B

𝐵𝑟 = 𝑤|𝑤 = −𝑏, 𝑓𝑜𝑟𝑏 ∈ 𝐵

• Translation of a set B by point z=(z1, z2)

𝐵 𝑧 = 𝑐|𝑐 = 𝑏 + 𝑧, 𝑓𝑜𝑟𝑏 ∈ 𝐵
Examples of Reflection and
Translation
Morphological image processing

• Structuring element (SE): small sets or sub-images used to probe an


image for properties of interest

• Origin of SE

• It should be rectangular: filling with smallest number of background


elements
Structuring Elements
Small sets or sub-images used to probe an image under study for properties of interest is called SE
How Structuring Elements are used
 The Background border is made large enough to accommodate the entire structuring
element when its origin is on the border of the original set (Padding)
 SE is of size 3×3 with the origin in the center, so as a one element border that
encompasses the entire set is sufficient
Erosion

• A, B are sets in Z2.

• The erosion of A by B,
𝐴Θ𝐵 = 𝑧| 𝐵 𝑧 ⊆𝐴
• Erosion of A by B is the set of all points z such that B, translated by z,
is contained in A.
•B has to be contained in A is equivalent to B not sharing any common
elements with the background
Erosion
Erosion
Erosion

 Erosion shrinks or thins objects in a binary image

 Erosion as a morphological filtering operation in which image details smaller than


the structuring elements are filtered from the image
Dilation

• With A and B as sets in Z2 , the dilation of A by B is defined as


𝐴 ⊕ 𝐵 = 𝑧| 𝐵𝑟 𝑧 ∩𝐴≠𝜑
• Reflecting B about its origin, and shifting this reflection by z
• The dilation of A by B then is the set of all displacements, z, such that Br and A
overlap by at least one element

• SE and the image must overlap by at least one element.


• Erosion → shrinking or thinning operation
• Dilation → grows or thickens objects in a binary image
Dilation
Dilation

 Unlike erosion, dilation “grows” or “thickens” objects in a binary image


 The specific manner and extent of this thickening is controlled by the shape of
the structuring element used
 Used for bridging gaps
Dilation
Opening
• Opening of set A by SE B is defined

𝐴 ∘ 𝐵 = 𝐴Θ𝐵 ⊕ 𝐵

• Thus, opening A by B is the erosion of A by B, followed by a dilation of the


result by B
• Smoothes the object contour
• Breaks narrow isthmuses
• Eliminates thin protrusions
Examples: Opening
Closing
• Closing of set A by SE B is defined
𝐴 • 𝐵 = 𝐴 ⊕ 𝐵 Θ𝐵
• Closing of set A by B is simply the dilation of A by B, followed by the
erosion of the result by B

• Smoothes the object contour


• Fuses narrow breaks
• Eliminates small holes
• Fills gaps in the contour
Examples: Closing
Closing and Opening
• Opening and closing are duals of each other with respect to set
complementation and reflections

Opening Properties:
• A o B is a subset of A
• If C is a subset of D, then C o B is a subset of D o B
• (A o B) o B = A o B

Closing properties:
• A is a subset of A ● B
• If C is a subset of D, then C ● B is a subset of D ● B
• (A ● B) ● B = A ● B
Closing
Hit-or-Miss Transformation

 The hit-or-miss transform is a general binary morphological operation that can be


used to look for particular patterns of foreground and background pixels in an image.
 The hit-and-miss transform is a basic tool for shape detection.
 Concept: To detect a shape:
 Hit : object
 Miss : background
Hit-or-Miss Transformation
 The hit-or-miss transform is defined as:
 Let B ={B1, B2}, B1, for detecting shapes in the foreground, and
B2 , for detecting shapes in the background..

 B1: Object related


 B2: Background related
Some Basic Morphological
Algorithms
 Boundary Extraction
 Hole Filling
 Extraction of Connected Components
 Thinning and Thickening
 Skeletons
 Convex Hull
 Pruning
Boundary extraction

𝛽(𝐴) = 𝐴 − 𝐴Θ𝐵
Boundary extraction
Boundary extraction
Hole Filling
 A hole may be defined as a background region surrounded by a connected
border of foreground pixels
 Let A denote a set whose elements are 8-connected boundaries, each boundary
enclosing a background region (i.e., a hole). Given a point in each hole, the
objective is to fill all the holes with 1s
 Forming an array X0 of 0s (the same size as the array containing A), except the
locations in X0 corresponding to the given point in each hole, which we set to 1.

 Stop the iteration if Xk = Xk-1


Hole Filling
Extraction of Connected
Components
 Extraction of connected components from a binary image is central to
many automated image analysis applications
 Let A be a set containing one or more connected components , and
form an array X0 (of the same size as the array containing A) whose
elements are 0s (background values), except at each location known
to correspond to a point in each connected component in A, which we
set to 1 (foreground value)
Extraction of Connected
Components

 Stop the iteration if Xk = Xk-1


 B is a SE
 SE used is based on 8-connectivity between pixels
Extraction of Connected
Components
Extraction of Connected
Components
Convex Hull
Convex Hull
Convex Hull
Thinning
 The thinning of a set A by a structuring element B, defined

 A more useful expression for thinning A symmetrically is based


on a sequence of structuring elements:

 The thinning of A by a sequence of structuring element {B}


Thickening
Thickening
Skeletons
Skeletons
Pruning

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy