DIGITAL IMAGE PROCESSING
DIGITAL IMAGE PROCESSING
IMAGE SEGMENTATION
IMAGE SEGMENTATION
Introduction
• Image segmentation divides an image into regions that are
connected and have some similarity within the region and
some difference between adjacent regions.
• The goal is usually to find individual objects in an image.
• For the most part there are fundamentally two kinds of
approaches to segmentation: discontinuity and similarity.
– Similarity may be due to pixel intensity, color or texture.
– Differences are sudden changes (discontinuities) in any of these, but
especially sudden changes in intensity along a boundary line, which is
called an edge.
Detection of Discontinuities
• There are three kinds of discontinuities of intensity: points,
lines and edges.
• The most common way to look for discontinuities is to scan a
small mask over the image. The mask determines which kind
of discontinuity to look for.







9
1
9
9
2
2
1
1 ...
i
i
i z
w
z
w
z
w
z
w
R
Detection of Discontinuities
Point Detection
threshold
e
nonnegativ
a
:
where T
T
R 
Detection of Discontinuities
Line Detection
• Only slightly more common than point detection is to find a
one pixel wide line in an image.
• For digital images the only three point straight lines are only
horizontal, vertical, or diagonal (+ or –45).
Detection of Discontinuities
Line Detection
Detection of Discontinuities
Edge Detection
Detection of Discontinuities
Edge Detection
Detection of Discontinuities
Edge Detection
Detection of Discontinuities
Edge Detection
Detection of Discontinuities
Gradient Operators
• First-order derivatives:
– The gradient of an image f(x,y) at location (x,y) is defined
as the vector:
– The magnitude of this vector:
– The direction of this vector:





















y
f
x
f
y
x
G
G
f
 2
1
2
2
)
(
mag y
x G
G
f 



 f








 
x
y
G
G
y
x 1
tan
)
,
(

Detection of Discontinuities
Gradient Operators
Roberts cross-gradient operators
Prewitt operators
Sobel operators
Detection of Discontinuities
Gradient Operators
Prewitt masks for
detecting diagonal edges
Sobel masks for
detecting diagonal edges
y
x G
G
f 


Detection of Discontinuities
Gradient Operators: Example
Detection of Discontinuities
Gradient Operators: Example
Detection of Discontinuities
Gradient Operators: Example
Detection of Discontinuities
Gradient Operators
• Second-order derivatives: (The Laplacian)
– The Laplacian of an 2D function f(x,y) is defined as
– Two forms in practice:
2
2
2
2
2
y
f
x
f
f







Detection of Discontinuities
Gradient Operators
• Consider the function:
• The Laplacian of h is
• The Laplacian of a Gaussian sometimes is called the Mexican
hat function. It also can be computed by smoothing the image
with the Gaussian smoothing mask, followed by application of
the Laplacian mask.
deviation
standard
the
:
and
where
)
( 2
2
2
2 2
2


y
x
r
e
r
h
r





2
2
2
4
2
2
2
)
( 


r
e
r
r
h






 



The Laplacian of a
Gaussian (LoG)
A Gaussian function
Detection of Discontinuities
Gradient Operators
Detection of Discontinuities
Gradient Operators: Example
Sobel gradient
Laplacian mask
Gaussian smooth function
Detection of Discontinuities
Gradient Operators: Example
Edge Linking and Boundary Detection
Local Processing
• Two properties of edge points are useful for edge linking:
– the strength (or magnitude) of the detected edge points
– their directions (determined from gradient directions)
• This is usually done in local neighborhoods.
• Adjacent edge points with similar magnitude and direction are
linked.
• For example, an edge pixel with coordinates (x0,y0) in a
predefined neighborhood of (x,y) is similar to the pixel at (x,y)
if
threshold
e
nonnegativ
a
:
,
)
,
(
)
,
( 0
0 E
E
y
x
y
x
f 



threshold
angle
nonegative
a
:
,
)
,
(
)
,
( 0
0 A
A
y
x
y
x 
 

Edge Linking and Boundary Detection
Local Processing: Algorithm
1. Compute the gradient magnitude and angle arrays, M(x, y) and α(x,
y), of the input image, f(x, y).
2. Form a binary image, g(x, y), whose value at any pair of
coordinates (x, y) is given by:
where TM is a threshold, A is a specific angle direction, and ±TA
defines a “band” of acceptable direction about A.
3. Scan the rows of g and fill all gaps in each row that do not exceed a
specified length, K.
4. To detect gaps in other direction, θ, rotate g by this angle and
apply the horizontal scanning procedure in step 3. Rotate the result
back by –θ.
1, ( , ) AND ( , )
( , )
0, Otherwise
M A
M x y T x y A T
g x y

  



Edge Linking and Boundary Detection
Local Processing: Example
In this example,
we can find the
license plate
candidate after
edge linking
process.
Edge Linking and Boundary Detection
Global Processing via the Hough Transform
Edge Linking and Boundary Detection
Global Processing via the Hough Transform
• Hough transform: a way of finding edge points in an image
that lie along a straight line.
• Example: xy-plane v.s. ab-plane (parameter space)
b
ax
y i
i 

Edge Linking and Boundary Detection
Global Processing via the Hough Transform
• The Hough transform consists of
finding all pairs of values of 
and  which satisfy the equations
that pass through (x,y).
• These are accumulated in what is
basically a 2-dimensional
histogram.
• When plotted these pairs of  and
 will look like a sine wave. The
process is repeated for all
appropriate (x,y) locations.


 
 sin
cos y
x
Edge Linking and Boundary Detection
Hough Transform Example
The intersection of the
curves corresponding
to points 1,3,5
2,3,4
1,4
Edge Linking and Boundary Detection
Hough Transform Example
Thresholding
• Assumption: the range of intensity levels covered by objects
of interest is different from the background.
Single threshold Multiple threshold






T
y
x
f
T
y
x
f
y
x
g
)
,
(
if
0
)
,
(
if
1
)
,
(
Thresholding
The Role of Illumination
Thresholding
The Role of Illumination
(a) (c)
(e)
(d)
)
,
(
)
,
(
)
,
( y
x
r
y
x
i
y
x
f 
)
,
( y
x
i
)
,
( y
x
r
Thresholding
Basic Global Thresholding
Thresholding
Basic Global Thresholding
Thresholding
Basic Adaptive Thresholding
Thresholding
Basic Adaptive Thresholding
How to solve this problem?
Thresholding
Basic Adaptive Thresholding
Answer: subdivision
Thresholding
Optimal Global and Adaptive Thresholding
• This method treats pixel values as probability density functions.
• The goal of this method is to minimize the probability of
misclassifying pixels as either object or background.
• There are two kinds of error:
– mislabeling an object pixel as background, and
– mislabeling a background pixel as object.
Thresholding
Use of Boundary Characteristics
Thresholding
Thresholds Based on Several Variables
Color image
Region-Based Segmentation
• Edges and thresholds sometimes do not give good
results for segmentation.
• Region-based segmentation is based on the
connectivity of similar pixels in a region.
– Each region must be uniform.
– Connectivity of the pixels within the region is very
important.
• There are two main approaches to region-based
segmentation: region growing and region splitting.
Region-Based Segmentation
Basic Formulation
• Let R represent the entire image region.
• Segmentation is a process that partitions R into subregions,
R1,R2,…,Rn, such that
where P(Rk): a logical predicate defined over the points in set Rk
For example: P(Rk)=TRUE if all pixels in Rk have the same gray
level.
R
Ri
n
i



1
(a)
j
i
j
i
R
R j
i 

 ,
and
all
for
(c) 
n
i
Ri ,...,
2
,
1
region,
connected
a
is
(b) 
n
i
R
P i ,...,
2
,
1
for
TRUE
)
(
(d) 

j
i
j
i R
R
R
R
P and
regions
adjacent
any
for
FALSE
)
(
(e) 

Region-Based Segmentation
Region Growing
Region-Based Segmentation
Region Growing
• Fig. 10.41 shows the histogram of Fig. 10.40 (a). It is difficult to
segment the defects by thresholding methods. (Applying region
growing methods are better in this case.)
Figure 10.41
Figure 10.40(a)
Region-Based Segmentation
Region Splitting and Merging
• Region splitting is the opposite of region growing.
– First there is a large region (possible the entire image).
– Then a predicate (measurement) is used to determine if the
region is uniform.
– If not, then the method requires that the region be split into
two regions.
– Then each of these two regions is independently tested by
the predicate (measurement).
– This procedure continues until all resulting regions are
uniform.
Region-Based Segmentation
Region Splitting
• The main problem with region splitting is determining where to
split a region.
• One method to divide a region is to use a quadtree structure.
• Quadtree: a tree in which nodes have exactly four descendants.
Region-Based Segmentation
Region Splitting and Merging
• The split and merge procedure:
– Split into four disjoint quadrants any region Ri for which
P(Ri) = FALSE.
– Merge any adjacent regions Rj and Rk for which P(RjURk) =
TRUE. (the quadtree structure may not be preserved)
– Stop when no further merging or splitting is possible.
Segmentation by Morphological Watersheds
• The concept of watersheds is based on visualizing an image in
three dimensions: two spatial coordinates versus gray levels.
• In such a topographic interpretation, we consider three types
of points:
– (a) points belonging to a regional minimum
– (b) points at which a drop of water would fall with
certainty to a single minimum
– (c) points at which water would be equally likely to fall to
more than one such minimum
• The principal objective of segmentation algorithms based on
these concepts is to find the watershed lines.
Segmentation by Morphological Watersheds
Example
Segmentation by Morphological Watersheds
Example
Segmentation by Morphological Watersheds
Example
The Use of Motion in Segmentation
• ADI: accumulative difference image
The Use of Motion in Segmentation

More Related Content

PPT
Chapter10 image segmentation
PPT
Image segmentation
PPTX
image segmentation image segmentation.pptx
PPTX
Digital Image Processing -Unit-3 - L1.pptx
PPT
Chapter10_Segmentation.ppt
PPT
MODULE_4_part1_Intro_image-segzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
PPT
MODULE_4_part1_Intro_image-segmentation.ppt AAAAAAAAAAAAAAAAAAAAAAA
Chapter10 image segmentation
Image segmentation
image segmentation image segmentation.pptx
Digital Image Processing -Unit-3 - L1.pptx
Chapter10_Segmentation.ppt
MODULE_4_part1_Intro_image-segzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
MODULE_4_part1_Intro_image-segmentation.ppt AAAAAAAAAAAAAAAAAAAAAAA

Similar to digital imagesegmentation-191212120951.ppt (20)

PPTX
Image segmentation
PDF
Lecture 8_Image Segmentation_2_dip__.pdf
PPTX
IMAGE SEGMENTATION.
PDF
UNIT-4.pdf image processing btech aktu notes
PDF
Module-5-1_230523_171754 (1).pdf
PPTX
Lecture 06 - image processingcourse1.pptx
PDF
Image segmentation
PDF
Image segmentation
PDF
Lecture 8_Image Segmentation_3_dip__.pdf
PDF
J017426467
PPTX
Image segmentation
PPT
Image processing9 segmentation(pointslinesedges)
PPT
image-processing-husseina-ozigi-otaru.ppt
PPT
Im seg04
PPT
ImSeg04 (2).ppt
PPT
ImSeg04.ppt
PDF
A Novel Edge Detection Technique for Image Classification and Analysis
PPTX
IMAGE SEGMENTATION TECHNIQUES
PPTX
image segmentation by Rajesh
PDF
SIRG-BSU_3_used-important.pdf
Image segmentation
Lecture 8_Image Segmentation_2_dip__.pdf
IMAGE SEGMENTATION.
UNIT-4.pdf image processing btech aktu notes
Module-5-1_230523_171754 (1).pdf
Lecture 06 - image processingcourse1.pptx
Image segmentation
Image segmentation
Lecture 8_Image Segmentation_3_dip__.pdf
J017426467
Image segmentation
Image processing9 segmentation(pointslinesedges)
image-processing-husseina-ozigi-otaru.ppt
Im seg04
ImSeg04 (2).ppt
ImSeg04.ppt
A Novel Edge Detection Technique for Image Classification and Analysis
IMAGE SEGMENTATION TECHNIQUES
image segmentation by Rajesh
SIRG-BSU_3_used-important.pdf
Ad

Recently uploaded (20)

PDF
Design of Material Handling Equipment Lecture Note
PDF
Computer System Architecture 3rd Edition-M Morris Mano.pdf
PPTX
Unit_1_introduction to surveying for diploma.pptx
PDF
Principles of operation, construction, theory, advantages and disadvantages, ...
PDF
UEFA_Carbon_Footprint_Calculator_Methology_2.0.pdf
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PPTX
AI-Reporting for Emerging Technologies(BS Computer Engineering)
PPTX
MAD Unit - 3 User Interface and Data Management (Diploma IT)
PDF
Computer organization and architecuture Digital Notes....pdf
PPTX
Micro1New.ppt.pptx the mai themes of micfrobiology
PPTX
Amdahl’s law is explained in the above power point presentations
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PDF
VTU IOT LAB MANUAL (BCS701) Computer science and Engineering
PDF
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
PDF
electrical machines course file-anna university
PPTX
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
PDF
MLpara ingenieira CIVIL, meca Y AMBIENTAL
PDF
VSL-Strand-Post-tensioning-Systems-Technical-Catalogue_2019-01.pdf
PPTX
Wireless sensor networks (WSN) SRM unit 2
PPTX
BBOC407 BIOLOGY FOR ENGINEERS (CS) - MODULE 1 PART 1.pptx
Design of Material Handling Equipment Lecture Note
Computer System Architecture 3rd Edition-M Morris Mano.pdf
Unit_1_introduction to surveying for diploma.pptx
Principles of operation, construction, theory, advantages and disadvantages, ...
UEFA_Carbon_Footprint_Calculator_Methology_2.0.pdf
August 2025 - Top 10 Read Articles in Network Security & Its Applications
AI-Reporting for Emerging Technologies(BS Computer Engineering)
MAD Unit - 3 User Interface and Data Management (Diploma IT)
Computer organization and architecuture Digital Notes....pdf
Micro1New.ppt.pptx the mai themes of micfrobiology
Amdahl’s law is explained in the above power point presentations
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
VTU IOT LAB MANUAL (BCS701) Computer science and Engineering
Unit I -OPERATING SYSTEMS_SRM_KATTANKULATHUR.pptx.pdf
electrical machines course file-anna university
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
MLpara ingenieira CIVIL, meca Y AMBIENTAL
VSL-Strand-Post-tensioning-Systems-Technical-Catalogue_2019-01.pdf
Wireless sensor networks (WSN) SRM unit 2
BBOC407 BIOLOGY FOR ENGINEERS (CS) - MODULE 1 PART 1.pptx
Ad

digital imagesegmentation-191212120951.ppt

  • 1. DIGITAL IMAGE PROCESSING DIGITAL IMAGE PROCESSING IMAGE SEGMENTATION IMAGE SEGMENTATION
  • 2. Introduction • Image segmentation divides an image into regions that are connected and have some similarity within the region and some difference between adjacent regions. • The goal is usually to find individual objects in an image. • For the most part there are fundamentally two kinds of approaches to segmentation: discontinuity and similarity. – Similarity may be due to pixel intensity, color or texture. – Differences are sudden changes (discontinuities) in any of these, but especially sudden changes in intensity along a boundary line, which is called an edge.
  • 3. Detection of Discontinuities • There are three kinds of discontinuities of intensity: points, lines and edges. • The most common way to look for discontinuities is to scan a small mask over the image. The mask determines which kind of discontinuity to look for.        9 1 9 9 2 2 1 1 ... i i i z w z w z w z w R
  • 4. Detection of Discontinuities Point Detection threshold e nonnegativ a : where T T R 
  • 5. Detection of Discontinuities Line Detection • Only slightly more common than point detection is to find a one pixel wide line in an image. • For digital images the only three point straight lines are only horizontal, vertical, or diagonal (+ or –45).
  • 11. Detection of Discontinuities Gradient Operators • First-order derivatives: – The gradient of an image f(x,y) at location (x,y) is defined as the vector: – The magnitude of this vector: – The direction of this vector:                      y f x f y x G G f  2 1 2 2 ) ( mag y x G G f      f           x y G G y x 1 tan ) , ( 
  • 12. Detection of Discontinuities Gradient Operators Roberts cross-gradient operators Prewitt operators Sobel operators
  • 13. Detection of Discontinuities Gradient Operators Prewitt masks for detecting diagonal edges Sobel masks for detecting diagonal edges
  • 14. y x G G f    Detection of Discontinuities Gradient Operators: Example
  • 17. Detection of Discontinuities Gradient Operators • Second-order derivatives: (The Laplacian) – The Laplacian of an 2D function f(x,y) is defined as – Two forms in practice: 2 2 2 2 2 y f x f f       
  • 18. Detection of Discontinuities Gradient Operators • Consider the function: • The Laplacian of h is • The Laplacian of a Gaussian sometimes is called the Mexican hat function. It also can be computed by smoothing the image with the Gaussian smoothing mask, followed by application of the Laplacian mask. deviation standard the : and where ) ( 2 2 2 2 2 2   y x r e r h r      2 2 2 4 2 2 2 ) (    r e r r h            The Laplacian of a Gaussian (LoG) A Gaussian function
  • 20. Detection of Discontinuities Gradient Operators: Example Sobel gradient Laplacian mask Gaussian smooth function
  • 22. Edge Linking and Boundary Detection Local Processing • Two properties of edge points are useful for edge linking: – the strength (or magnitude) of the detected edge points – their directions (determined from gradient directions) • This is usually done in local neighborhoods. • Adjacent edge points with similar magnitude and direction are linked. • For example, an edge pixel with coordinates (x0,y0) in a predefined neighborhood of (x,y) is similar to the pixel at (x,y) if threshold e nonnegativ a : , ) , ( ) , ( 0 0 E E y x y x f     threshold angle nonegative a : , ) , ( ) , ( 0 0 A A y x y x    
  • 23. Edge Linking and Boundary Detection Local Processing: Algorithm 1. Compute the gradient magnitude and angle arrays, M(x, y) and α(x, y), of the input image, f(x, y). 2. Form a binary image, g(x, y), whose value at any pair of coordinates (x, y) is given by: where TM is a threshold, A is a specific angle direction, and ±TA defines a “band” of acceptable direction about A. 3. Scan the rows of g and fill all gaps in each row that do not exceed a specified length, K. 4. To detect gaps in other direction, θ, rotate g by this angle and apply the horizontal scanning procedure in step 3. Rotate the result back by –θ. 1, ( , ) AND ( , ) ( , ) 0, Otherwise M A M x y T x y A T g x y       
  • 24. Edge Linking and Boundary Detection Local Processing: Example In this example, we can find the license plate candidate after edge linking process.
  • 25. Edge Linking and Boundary Detection Global Processing via the Hough Transform
  • 26. Edge Linking and Boundary Detection Global Processing via the Hough Transform • Hough transform: a way of finding edge points in an image that lie along a straight line. • Example: xy-plane v.s. ab-plane (parameter space) b ax y i i  
  • 27. Edge Linking and Boundary Detection Global Processing via the Hough Transform • The Hough transform consists of finding all pairs of values of  and  which satisfy the equations that pass through (x,y). • These are accumulated in what is basically a 2-dimensional histogram. • When plotted these pairs of  and  will look like a sine wave. The process is repeated for all appropriate (x,y) locations.      sin cos y x
  • 28. Edge Linking and Boundary Detection Hough Transform Example The intersection of the curves corresponding to points 1,3,5 2,3,4 1,4
  • 29. Edge Linking and Boundary Detection Hough Transform Example
  • 30. Thresholding • Assumption: the range of intensity levels covered by objects of interest is different from the background. Single threshold Multiple threshold       T y x f T y x f y x g ) , ( if 0 ) , ( if 1 ) , (
  • 31. Thresholding The Role of Illumination
  • 32. Thresholding The Role of Illumination (a) (c) (e) (d) ) , ( ) , ( ) , ( y x r y x i y x f  ) , ( y x i ) , ( y x r
  • 38. Thresholding Optimal Global and Adaptive Thresholding • This method treats pixel values as probability density functions. • The goal of this method is to minimize the probability of misclassifying pixels as either object or background. • There are two kinds of error: – mislabeling an object pixel as background, and – mislabeling a background pixel as object.
  • 39. Thresholding Use of Boundary Characteristics
  • 40. Thresholding Thresholds Based on Several Variables Color image
  • 41. Region-Based Segmentation • Edges and thresholds sometimes do not give good results for segmentation. • Region-based segmentation is based on the connectivity of similar pixels in a region. – Each region must be uniform. – Connectivity of the pixels within the region is very important. • There are two main approaches to region-based segmentation: region growing and region splitting.
  • 42. Region-Based Segmentation Basic Formulation • Let R represent the entire image region. • Segmentation is a process that partitions R into subregions, R1,R2,…,Rn, such that where P(Rk): a logical predicate defined over the points in set Rk For example: P(Rk)=TRUE if all pixels in Rk have the same gray level. R Ri n i    1 (a) j i j i R R j i    , and all for (c)  n i Ri ,..., 2 , 1 region, connected a is (b)  n i R P i ,..., 2 , 1 for TRUE ) ( (d)   j i j i R R R R P and regions adjacent any for FALSE ) ( (e)  
  • 44. Region-Based Segmentation Region Growing • Fig. 10.41 shows the histogram of Fig. 10.40 (a). It is difficult to segment the defects by thresholding methods. (Applying region growing methods are better in this case.) Figure 10.41 Figure 10.40(a)
  • 45. Region-Based Segmentation Region Splitting and Merging • Region splitting is the opposite of region growing. – First there is a large region (possible the entire image). – Then a predicate (measurement) is used to determine if the region is uniform. – If not, then the method requires that the region be split into two regions. – Then each of these two regions is independently tested by the predicate (measurement). – This procedure continues until all resulting regions are uniform.
  • 46. Region-Based Segmentation Region Splitting • The main problem with region splitting is determining where to split a region. • One method to divide a region is to use a quadtree structure. • Quadtree: a tree in which nodes have exactly four descendants.
  • 47. Region-Based Segmentation Region Splitting and Merging • The split and merge procedure: – Split into four disjoint quadrants any region Ri for which P(Ri) = FALSE. – Merge any adjacent regions Rj and Rk for which P(RjURk) = TRUE. (the quadtree structure may not be preserved) – Stop when no further merging or splitting is possible.
  • 48. Segmentation by Morphological Watersheds • The concept of watersheds is based on visualizing an image in three dimensions: two spatial coordinates versus gray levels. • In such a topographic interpretation, we consider three types of points: – (a) points belonging to a regional minimum – (b) points at which a drop of water would fall with certainty to a single minimum – (c) points at which water would be equally likely to fall to more than one such minimum • The principal objective of segmentation algorithms based on these concepts is to find the watershed lines.
  • 49. Segmentation by Morphological Watersheds Example
  • 50. Segmentation by Morphological Watersheds Example
  • 51. Segmentation by Morphological Watersheds Example
  • 52. The Use of Motion in Segmentation • ADI: accumulative difference image
  • 53. The Use of Motion in Segmentation