www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10
Image Segmentation
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Chapter 10
Image Segmentation
• 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.
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
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
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Point Detection
threshold e nonnegativ a : where T
T R >
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
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°).
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Line Detection
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Edge Detection
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Edge Detection
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Edge Detection
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Edge Detection
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Gradient Operators
• Firstorder 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:
(
(
¸
(
¸
=
(
¸
(
¸
= V
c
c
c
c
y
f
x
f
y
x
G
G
f
 
2
1
2 2
) ( mag
y x
G G f + = V = V f


.

\

=
÷
y
x
G
G
y x
1
tan ) , ( o
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Gradient Operators
Roberts crossgradient operators
Prewitt operators
Sobel operators
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Gradient Operators
Prewitt masks for
detecting diagonal edges
Sobel masks for
detecting diagonal edges
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
y x
G G f + ~ V
Detection of Discontinuities
Gradient Operators: Example
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Gradient Operators: Example
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Gradient Operators: Example
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Gradient Operators
• Secondorder 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
c
c
+
c
c
= V
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
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
o
o
y x r e r h
r
+ = ÷ =
÷
2
2
2
4
2 2
2
) (
o
o
o
r
e
r
r h
÷
(
¸
(
¸
÷
÷ = V
The Laplacian of a
Gaussian (LoG)
A Gaussian function
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Gradient Operators
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Gradient Operators: Example
Sobel gradient
Laplacian mask Gaussian smooth function
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Detection of Discontinuities
Gradient Operators: Example
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
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 (x
0
,y
0
) 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 s V ÷ V
threshold angle nonegative a : , ) , ( ) , (
0 0
A A y x y x < ÷o o
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Edge Linking and Boundary Detection
Local Processing: Example
In this example,
we can find the
license plate
candidate after
edge linking
process.
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
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: xyplane v.s. abplane (parameter space)
b ax y
i i
+ =
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Edge Linking and Boundary Detection
Global Processing via the Hough Transform
• The Hough transform consists of
finding all pairs of values of u
and µ which satisfy the equations
that pass through (x,y).
• These are accumulated in what is
basically a 2dimensional
histogram.
• When plotted these pairs of u and
µ will look like a sine wave. The
process is repeated for all
appropriate (x,y) locations.
µ u u = + sin cos y x
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Edge Linking and Boundary Detection
Hough Transform Example
The intersection of the
curves corresponding
to points 1,3,5
2,3,4
1,4
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Edge Linking and Boundary Detection
Hough Transform Example
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Thresholding
• Assumption: the range of intensity levels covered by objects of
interest is different from the background.
Single threshold
Multiple threshold
¹
´
¦
s
>
=
T y x f
T y x f
y x g
) , ( if 0
) , ( if 1
) , (
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Thresholding
The Role of Illumination
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Thresholding
The Role of Illumination
(a) (c)
(e)
(d)
) , ( ) , ( ) , ( y x r y x i y x f =
) , ( y x i
) , ( y x r
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Thresholding
Basic Global Thresholding
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Thresholding
Basic Global Thresholding
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Thresholding
Basic Adaptive Thresholding
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Thresholding
Basic Adaptive Thresholding
How to solve this problem?
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Thresholding
Basic Adaptive Thresholding
Answer: subdivision
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
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.
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Thresholding
Use of Boundary Characteristics
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Thresholding
Thresholds Based on Several Variables
Color image
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
RegionBased Segmentation
• Edges and thresholds sometimes do not give good
results for segmentation.
• Regionbased 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 regionbased
segmentation: region growing and region splitting.
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
RegionBased Segmentation
Basic Formulation
• Let R represent the entire image region.
• Segmentation is a process that partitions R into subregions,
R
1
,R
2
,…,R
n
, such that
where P(R
k
): a logical predicate defined over the points in set R
k
For example: P(R
k
)=TRUE if all pixels in R
k
have the same gray
level.
R R
i
n
i
=
=1
(a)
j i j i R R
j i
= = · , and all for (c) 
n i R
i
,..., 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) =
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
RegionBased Segmentation
Region Growing
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
RegionBased 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)
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
RegionBased 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.
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
RegionBased 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.
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
RegionBased Segmentation
Region Splitting and Merging
• The split and merge procedure:
– Split into four disjoint quadrants any region R
i
for which
P(R
i
) = FALSE.
– Merge any adjacent regions R
j
and R
k
for which P(R
j
UR
k
) =
TRUE. (the quadtree structure may not be preserved)
– Stop when no further merging or splitting is possible.
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
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.
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Segmentation by Morphological Watersheds
Example
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Segmentation by Morphological Watersheds
Example
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
Segmentation by Morphological Watersheds
Example
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
The Use of Motion in Segmentation
• ADI: accumulative difference image
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
© 2002 R. C. Gonzalez & R. E. Woods
The Use of Motion in Segmentation
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
Chapter 10 Image Segmentation • 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.
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
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.
R w1 z1 w2 z 2 ... w9 z9 wi zi
i 1 9
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
Detection of Discontinuities Point Detection
R T where T : a nonnegative threshold
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed.
www.imageprocessingbook.com
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).
© 2002 R. C. Gonzalez & R. E. Woods
Woods . 2nd ed. C. www.imageprocessingbook. Gonzalez & R.com Detection of Discontinuities Line Detection © 2002 R. E.Digital Image Processing.
E. 2nd ed. Gonzalez & R. C.com Detection of Discontinuities Edge Detection © 2002 R.imageprocessingbook. Woods . www.Digital Image Processing.
2nd ed.com Detection of Discontinuities Edge Detection © 2002 R. E.Digital Image Processing. www. C. Gonzalez & R. Woods .imageprocessingbook.
E. Woods . 2nd ed.com Detection of Discontinuities Edge Detection © 2002 R. Gonzalez & R.Digital Image Processing. C.imageprocessingbook. www.
www. C. 2nd ed. Gonzalez & R.com Detection of Discontinuities Edge Detection © 2002 R.imageprocessingbook. E.Digital Image Processing. Woods .
E. Woods .y) is defined as the vector: G x f G y f x f y – The magnitude of this vector: f mag(f ) G G 2 x 2 y 1 2 – The direction of this vector: Gx ( x. www. y ) tan G y 1 © 2002 R. C.Digital Image Processing. Gonzalez & R.com Detection of Discontinuities Gradient Operators • Firstorder derivatives: – The gradient of an image f(x.imageprocessingbook.y) at location (x. 2nd ed.
Gonzalez & R.com Detection of Discontinuities Gradient Operators Roberts crossgradient operators Prewitt operators Sobel operators © 2002 R.imageprocessingbook. Woods . www.Digital Image Processing. 2nd ed. E. C.
Gonzalez & R. 2nd ed.com Detection of Discontinuities Gradient Operators Prewitt masks for detecting diagonal edges Sobel masks for detecting diagonal edges © 2002 R. www. Woods . C. E.Digital Image Processing.imageprocessingbook.
C.Digital Image Processing. Gonzalez & R.imageprocessingbook. E. www.com Detection of Discontinuities Gradient Operators: Example f Gx Gy © 2002 R. Woods . 2nd ed.
Woods .com Detection of Discontinuities Gradient Operators: Example © 2002 R. Gonzalez & R.imageprocessingbook. www. 2nd ed.Digital Image Processing. E. C.
E. Gonzalez & R.com Detection of Discontinuities Gradient Operators: Example © 2002 R.Digital Image Processing. 2nd ed. C. www.imageprocessingbook. Woods .
2nd ed. E. C.Digital Image Processing. Gonzalez & R.com Detection of Discontinuities Gradient Operators • Secondorder derivatives: (The Laplacian) – The Laplacian of an 2D function f(x. www.y) is defined as 2 f 2 f 2 f 2 2 x y – Two forms in practice: © 2002 R. Woods .imageprocessingbook.
imageprocessingbook. Woods . followed by application of the Laplacian mask. © 2002 R. 2nd ed. It also can be computed by smoothing the image with the Gaussian smoothing mask.Digital Image Processing. www. Gonzalez & R. E.com Detection of Discontinuities Gradient Operators • Consider the function: A Gaussian function h(r ) e r2 2 2 where r 2 x 2 y 2 and : the standard deviation r2 • The Laplacian of h is r 2 2 h( r ) e 4 2 2 2 The Laplacian of a Gaussian (LoG) • The Laplacian of a Gaussian sometimes is called the Mexican hat function. C.
Gonzalez & R. Woods . www. C.com Detection of Discontinuities Gradient Operators © 2002 R. E.imageprocessingbook.Digital Image Processing. 2nd ed.
E.imageprocessingbook. C.com Detection of Discontinuities Gradient Operators: Example Sobel gradient © 2002 R. Gonzalez & R. Woods Gaussian smooth function Laplacian mask . www. 2nd ed.Digital Image Processing.
Gonzalez & R. C.Digital Image Processing. 2nd ed.com Detection of Discontinuities Gradient Operators: Example © 2002 R. Woods .imageprocessingbook. E. www.
y) if f ( x.y0) in a predefined neighborhood of (x. C. • For example.y) is similar to the pixel at (x. www. y) ( x0 . y) ( x0 . y0 ) A. Woods . y0 ) E. 2nd ed. an edge pixel with coordinates (x0.Digital Image Processing. A : a nonegative angle threshold © 2002 R. • Adjacent edge points with similar magnitude and direction are linked.com 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. E. Gonzalez & R. E : a nonnegative threshold ( x.imageprocessingbook.
2nd ed. © 2002 R.imageprocessingbook. www. E.Digital Image Processing. C. we can find the license plate candidate after edge linking process. Woods . Gonzalez & R.com Edge Linking and Boundary Detection Local Processing: Example In this example.
E. Gonzalez & R. • Example: xyplane v. www.Digital Image Processing.imageprocessingbook. abplane (parameter space) yi axi b © 2002 R. Woods .s. C.com 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. 2nd ed.
y). • These are accumulated in what is basically a 2dimensional histogram. E. Woods . Gonzalez & R. The process is repeated for all appropriate (x.Digital Image Processing. www. C.imageprocessingbook. • When plotted these pairs of and will look like a sine wave. 2nd ed.y) locations.com 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. x cos y sin © 2002 R.
3.4 © 2002 R. Gonzalez & R.com Edge Linking and Boundary Detection Hough Transform Example The intersection of the curves corresponding to points 1. Woods .imageprocessingbook. 2nd ed. E.5 2.4 1.Digital Image Processing. www. C.3.
2nd ed. E.com Edge Linking and Boundary Detection Hough Transform Example © 2002 R. www.imageprocessingbook. C. Woods . Gonzalez & R.Digital Image Processing.
com Thresholding • Assumption: the range of intensity levels covered by objects of interest is different from the background.imageprocessingbook. C. y) 0 if f ( x. 1 g ( x. 2nd ed. Gonzalez & R. www. y) T if f ( x.Digital Image Processing. E. Woods Multiple threshold . y) T Single threshold © 2002 R.
C.imageprocessingbook. Gonzalez & R.Digital Image Processing. 2nd ed. www.com Thresholding The Role of Illumination © 2002 R. E. Woods .
com Thresholding The Role of Illumination r ( x.imageprocessingbook. www. E.Digital Image Processing. 2nd ed. y) (a) (c) (d) (e) i( x. Gonzalez & R. y) f ( x. Woods . C. y) i( x. y) © 2002 R. y)r ( x.
2nd ed.Digital Image Processing.com Thresholding Basic Global Thresholding © 2002 R. Gonzalez & R. E. Woods . www. C.imageprocessingbook.
E.com Thresholding Basic Global Thresholding © 2002 R. C. www.Digital Image Processing.imageprocessingbook. Woods . 2nd ed. Gonzalez & R.
www. Woods . Gonzalez & R.imageprocessingbook.Digital Image Processing. 2nd ed. E. C.com Thresholding Basic Adaptive Thresholding © 2002 R.
2nd ed.com Thresholding Basic Adaptive Thresholding How to solve this problem? © 2002 R.Digital Image Processing. Gonzalez & R. E.imageprocessingbook. Woods . C. www.
www. C. E.com Thresholding Basic Adaptive Thresholding Answer: subdivision © 2002 R.imageprocessingbook. 2nd ed. Gonzalez & R.Digital Image Processing. Woods .
Digital Image Processing. Gonzalez & R. © 2002 R.imageprocessingbook. www. Woods . • The goal of this method is to minimize the probability of misclassifying pixels as either object or background. E.com Thresholding Optimal Global and Adaptive Thresholding • This method treats pixel values as probability density functions. 2nd ed. and – mislabeling a background pixel as object. • There are two kinds of error: – mislabeling an object pixel as background. C.
2nd ed.Digital Image Processing. E.com Thresholding Use of Boundary Characteristics © 2002 R. Gonzalez & R. www. C. Woods .imageprocessingbook.
imageprocessingbook.com Thresholding Thresholds Based on Several Variables Color image © 2002 R. Woods . Gonzalez & R.Digital Image Processing. www. E. 2nd ed. C.
www. 2nd ed. • Regionbased segmentation is based on the connectivity of similar pixels in a region.imageprocessingbook. • There are two main approaches to regionbased segmentation: region growing and region splitting. © 2002 R. C. – Connectivity of the pixels within the region is very important. E. Gonzalez & R. – Each region must be uniform.com RegionBased Segmentation • Edges and thresholds sometimes do not give good results for segmentation.Digital Image Processing. Woods .
i j (d) P( Ri ) TRUE for i 1.. • Segmentation is a process that partitions R into subregions. E.imageprocessingbook.2.. © 2002 R. n (e) P( Ri R j ) FALSE for any adjacent regions Ri and R j 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.Rn. Gonzalez & R. Woods . www..com RegionBased Segmentation Basic Formulation • Let R represent the entire image region... 2nd ed..R2. n (c) Ri R j for all i and j .2. C.. R1.Digital Image Processing.….. such that (a) Ri R i 1 n (b) Ri is a connected region. i 1.
C.Digital Image Processing. 2nd ed. www.com RegionBased Segmentation Region Growing © 2002 R. Woods .imageprocessingbook. Gonzalez & R. E.
E. 2nd ed. It is difficult to segment the defects by thresholding methods. (Applying region growing methods are better in this case. 10.com RegionBased Segmentation Region Growing • Fig.imageprocessingbook. 10.41 shows the histogram of Fig.41 . Gonzalez & R. www.) Figure 10.40 (a).Digital Image Processing.40(a) © 2002 R. Woods Figure 10. C.
then the method requires that the region be split into two regions. E.imageprocessingbook. © 2002 R. – First there is a large region (possible the entire image). Woods . C. – Then each of these two regions is independently tested by the predicate (measurement). – If not. www. – Then a predicate (measurement) is used to determine if the region is uniform. 2nd ed. – This procedure continues until all resulting regions are uniform. Gonzalez & R.com RegionBased Segmentation Region Splitting and Merging • Region splitting is the opposite of region growing.Digital Image Processing.
Digital Image Processing. • One method to divide a region is to use a quadtree structure. Woods . C. 2nd ed. E. Gonzalez & R. www.com RegionBased Segmentation Region Splitting • The main problem with region splitting is determining where to split a region. • Quadtree: a tree in which nodes have exactly four descendants.imageprocessingbook. © 2002 R.
C.Digital Image Processing. (the quadtree structure may not be preserved) – Stop when no further merging or splitting is possible. © 2002 R. Woods . E. – Merge any adjacent regions Rj and Rk for which P(RjURk) = TRUE. 2nd ed.imageprocessingbook.com RegionBased Segmentation Region Splitting and Merging • The split and merge procedure: – Split into four disjoint quadrants any region Ri for which P(Ri) = FALSE. Gonzalez & R. www.
E.Digital Image Processing. 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.com Segmentation by Morphological Watersheds • The concept of watersheds is based on visualizing an image in three dimensions: two spatial coordinates versus gray levels. C. 2nd ed. www. • In such a topographic interpretation. Woods . Gonzalez & R. © 2002 R.imageprocessingbook.
com Segmentation by Morphological Watersheds Example © 2002 R. 2nd ed. Gonzalez & R. C. E. www. Woods .imageprocessingbook.Digital Image Processing.
2nd ed. www. E. C.com Segmentation by Morphological Watersheds Example © 2002 R. Woods . Gonzalez & R.imageprocessingbook.Digital Image Processing.
C. Woods . Gonzalez & R. E.com Segmentation by Morphological Watersheds Example © 2002 R. www.imageprocessingbook.Digital Image Processing. 2nd ed.
Gonzalez & R. E. www.imageprocessingbook. Woods . C. 2nd ed.com The Use of Motion in Segmentation • ADI: accumulative difference image © 2002 R.Digital Image Processing.
imageprocessingbook. C. E.com The Use of Motion in Segmentation © 2002 R.Digital Image Processing. Woods . 2nd ed. Gonzalez & R. www.