Module 5
Module 5
Image Segmentation
Detection of Discontinuities
Line Detection
Illustration
Edge Detection
Edge Point
Gradient Operators
• Gradient: f
Gx x
f = = f
Gy
y
Gx
Gradient Masks
Illustration
Illustration (cont’d)
Illustration (cont’d)
Thresholding
Foundation
Region-Based Segmentation
Region Growing
•Look at the area of interest and decide if all pixels contained in the region satisfy
some similarity constraint.
•If TRUE then the area of interest corresponds to a region in the image.
•If FALSE split the area of interest (usually into four equal sub-areas) and consider
each of the sub-areas as the area of interest in turn.
•This process continues until no further splitting occurs. In the worst case this
happens when the areas are just one pixel in size.
Watershed lines
Morphological Operations
Morphology: a branch of biology that deals with the form and
structure of animals and plants
An approach for processing digital image based on its shape
A mathematical tool for investigating geometric structure in image
Morphological image processing is used to extract image components
for representation and description of region shape, such as
boundaries, skeletons, and the convex hull
The language of mathematical morphology is – Set theory.
Unified and powerful approach to numerous image processing
problems.
Simplify image data, preserve essential shape characteristics and
eliminate noise
Permits the underlying shape to be identified and optimally
reconstructed from their distorted, noisy forms
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 33
Union
Intersection
Dilation
• Dilation is used for expanding an element A by using structuring
element B
• Dilation of A by B and is defined by the following equation:
Dilation – Example 1
Dilation – Example 2
Dilation –Example
Erosion
Erosion – Example 1
Erosion – Example 2
Opening –
First – erode A by B, and then dilate the result by B
In other words, opening is the unification of all B objects
Entirely Contained in A
eliminates protrusions
breaks necks
smoothes contour
Properties
Opening
(i) AB is a subset (subimage) of A
(ii) If C is a subset of D, then C B is a subset of D B
(iii) (A B) B = A B
Closing
(i) A is a subset (subimage) of A•B
(ii) If C is a subset of D, then C •B is a subset of D •B
(iii) (A •B) •B = A •B
49
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 50
Morphological Operations
►Boundary Extraction
The boundary of a set A, can be obtained by first eroding A by B
and then performing the set difference between A and its erosion.
B = ( B1 , B2 )
B1 : object
B2 : background
A B = ( A − B1 ) ( Ac − B2 )
4/8/2025 52
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 53
Boundary Extraction
( A) = A − ( A − B)
Department of Computer Science & Engineering-Bangalore Campus 53
19ECS352 - Image Processing. Dr. Justin Varghese Slide 54
Region Filling
X k = ( X k −1 B) A k = 1,2,3,...c
Example
Gray-Scale Morphology
f ( x, y) : gray-scale image
b( x, y): structuring element
4/8/2025 58
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 59
f − b ( x, y) = (min
s ,t )b
f ( x + s, y + t )
f b ( x, y) = max
( s ,t )b
f ( x − s, y − t )
4/8/2025 59
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 60
4/8/2025 60
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 61
f − bN ( x, y) = (min
s ,t )b
f ( x + s, y + t ) − bN (s, t )
f bN ( x, y) = max
( s ,t )b
f ( x − s, y − t ) + bN (s, t )
4/8/2025 61
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 62
f −b c
( x, y) = f b ( x, y)
c
where f c = − f ( x, y) and b = b(− x, − y)
f −b c
= f b
c
( f b ) =
c
( f c
− b)
4/8/2025 62
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 63
f b = ( f − b) b
f • b = ( f b) − b
( f b) c
=f c
b=−f b
(f b) = f b = − f b
c c
4/8/2025 63
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 64
4/8/2025 64
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 65
(a) f bf
(b) if f1f 2 , then ( f1 b ) ( f 2 b )
(c) (f b) b = f b
4/8/2025 65
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 66
4/8/2025 66
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 67
Morphological Smoothing
4/8/2025 67
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 68
Morphological Smoothing
4/8/2025 68
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 69
Morphological Gradient
4/8/2025 69
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 70
Morphological Gradient
4/8/2025 70
Department of Computer Science & Engineering-Bangalore Campus
19ECS352 - Image Processing. Dr. Justin Varghese Slide 71
Questions?
Thank You