Professional Documents
Culture Documents
Segmentation Techniques
Performance Evaluation
Color Image Segmentation
Conclusion
Image Segmentation
Table of Contents
1 Introduction
Digital Image Processing
What is Image Segmentation?
Problem Definition
Methodology
2 Segmentation Techniques
Discontinuity Based Segmentation
Point and Line Detection
Edge Detection
Similarity Based Segmentation
Thresholding Based Segmentation
Region Based Segmentation
Clustering Based Segmentation
3 Performance Evaluation
4 Color Image Segmentation
5 Conclusion
Lecture Outline
1 Introduction
2 Techniques
3 Performance Evaluation
5 Conclusions
An image is a 2D function, I = f (x , y )
where x and y are spatial coordinates
Amplitude of f at any pair of coordinates (x , y ) is called the
intensity (I) or gray level of the image.
Definition
Image Segmentation is the partitioning of an image into
meaningful regions that have strong correlation with objects or
areas of the real world contained in the image.
Definition
Image Segmentation is a procedure that describes the process of
dividing an image into non overlapping, connected image areas,
called regions, on the basis of criteria governing similarity and
homogeneity.
Segmentation Examples
Segmentation Examples
Problem Definition
Problem Definition
Methodology
Methods of Segmentation
Discontinuity based
Detection of Isolated Points
Detection of Lines
Edge Detection
Similarity based
Thresholding
Region growing
Region Splitting and Merging
Clustering
K–Means Clustering
Fuzzy C Means Clustering
Measuring Discontinuity
Measuring Discontinuity
The sum of products of the mask coefficients with the
corresponding image gray values is computed for each pixel.
Measuring Discontinuity
9
R = w1 f1 + w2 f2 + w3 f3 + · · · + w9 f9 = wi fi
i =1
|R | > T
Points are detected at those pixels in the subsequent filtered
image above this threshold.
A 3 × 3 point detection mask can be represented as:
(a) X-ray Image (b) Result point detection (c) Result Thresholding
(a) Horizontal (b) +45 degree (c) Vertical (d) –45 degree
(a) Wire Bond Image (b) Line detection (c) Result Thresholding
Edge Detection
It is the most common approach for detection of gray level
discontinuity in an image.
Edge is a boundary between two regions having distinct
intensity levels.
Derivatives
∂f
= f (x + 1) − f (x )
∂x
Second derivative about a point x can be expressed as
∂2 f
= f (x + 1) + f (x − 1) − 2f (x )
∂x 2
90
85
80
75
70
65
60
55
50
0 2 4 6 8 10 12 14 16
(a) Intensity
40
40
30
30
20
20
10
10
0
0
−10
−10
−20
−20
−30 −30
−40 −40
0 5 10 15 0 2 4 6 8 10 12 14
Gradient Operator
f)
∇f = mag (∇
1
= [Gx2 + Gy2 ] 2
≈ |Gx | + |Gy |
Gradient Operator
f is
Direction of ∇
−1 Gy
α(x , y ) = tan (1)
Gx
f.
α(x , y ) provides the direction of ∇
f.
Edge direction is perpendicular to the direction of ∇
Prewitt Operator
Prewitt operator is a discrete differentiation operator, which
computes the gradient of the image intensity at each point
along with its orientation.
Two 3 × 3 kernels are convolved with the image to obtain the
derivatives for horizontal and vertical changes.
Sobel Operator
Sobel operator calculates the gradient of the image intensity
at each point.
Sobel operator uses two 3 × 3 kernels are convolved with the
image to obtain the derivatives for horizontal and vertical
changes.
Laplacian Operator
Laplacian is the second derivative
Laplacian operator of f (x , y ) is
∂2 f ∂2 f
∇2 f = +
∂x 2 ∂y 2
Mask implementing second derivative operator is given as
Edge Linking
Thresholding
Thresholding Example
Image Histogram
Image histogram describes the frequency of the intensity
values that occur in an image.
Histogram can be very efficiently used for determining the
threshold for image segmentation.
1000
900
800
700
600
Pixel Count
500
400
300
200
100
Bimodal Histogram
Bimodal Histogram
Bi–level Thresholding
Multimodal Histogram
Multimodal Histogram
Multimodal Thresholding
f(x, y) ≤ T2 ⇒ (x, y) ∈ R1
Thresholding Selection
where,
(x,y) ⇒ Pixel Location
p(x,y) ⇒ Local property in a neighborhood centered at (x , y ).
f(x,y) ⇒ Pixel intensity at (x , y ).
Thresholding Selection
Thresholding Selection
Thresholded Image
Threshold Estimation
3500
3000
2500
2000
1500
1000
500
Automatic Thresholding
Automatic Thresholding
Algorithm
1 Select an initial value of threshold T .
Automatic Thresholding
Algorithm
1 Select an initial value of threshold T .
Automatic Thresholding
Algorithm
1 Select an initial value of threshold T .
Automatic Thresholding
Algorithm
1 Select an initial value of threshold T .
Automatic Thresholding
Algorithm
1 Select an initial value of threshold T .
µ1 + µ2
T=
2
5 Repeat step 2-4 until
Ti − Ti +1 ≤ Th
62/116 Image Segmentation
Introduction
Segmentation Techniques
Discontinuity Based Segmentation
Performance Evaluation
Similarity Based Segmentation
Color Image Segmentation
Conclusion
Global Threshold
3000
2500
2000
1500
1000
500
Global Threshold
Optimal Thresholding
Optimal Thresholding
Optimal Thresholding
Optimal Thresholding
Optimal Thresholding
p (z ) = P1 p1 (z ) + P2 p2 (z )
where,
P1 indicates the probability that a pixel will belong to the
background.
P2 indicates the probability that a pixel will belong to the
object.
Sum of both the probabilities will be unity.
P1 + P2 = 1
Optimal Thresholding
Optimal Thresholding
f (x , y ) > T ⇒ Object
Pixels beyond T with intensity f (x , y ) also have a finite
probability that it may belong to the background.
Optimal Thresholding
Optimal Thresholding
E (T ) = P2 E1 (T ) + P1 E2 (T )
For minimizing this error we will take derivative of E (t ) and
equate to zero.
∂E (T )
=0
∂T
Under this condition what ever T we get will give us minimum
error.
P1 p1 (T ) = P2 p2 (T )
Optimal Thresholding
(µ1 + µ2 ) σ2 P2
T= + ln( )
2 µ1 − µ2 P1
Local Thresholding
Threshold selection is easier if the histogram of an image is:
Bimodal and modes are tall, narrow and separated by a deep
valley.
If the modes are symmetric.
Local Thresholding
Local Thresholding
Local Thresholding
Local Thresholding
Advantages
Thus the histogram will be symmetric.
Histogram will be independent of relative size of object and
background region.
The probability of a pixel belonging to object and the
probability of a pixel belonging to background within the
narrow strip is almost same.
Thresholding such an histogram will be easier.
Local Thresholding
Local Thresholding
Local Thresholding
Local Thresholding
⎧
⎪
⎪
⎪ 0 if ∇f < T
⎨
s (x , y ) = ⎪
⎪ + if ∇f ≥ T and∇2 f ≥ 0
⎪
⎩ − if ∇f ≥ T and∇2 f < 0
Local Thresholding
Local Thresholding
Region Definition
Considering all the pixels in an image as a set of pixels as R
The segmentation operation partitions the set of pixels R to
number of subregions say R1 , R2 , . . . Rn .
During partitioning certain properties are followed i.e.
n
R = R,
1 i
i=
Ri Rj = ∅ for i j,
P (Ri ) = TRUE for i=1,2,. . . , n
P (Ri Rj ) = FALSE for i j,
Where P (Ri ) is a predicate defined in terms of feature values
over region Ri .
All the pixels belonging to a particular region must be similar
and pixels belonging to two different region are dissimilar.
Regions must be connected, disjoint and homogeneous in
nature.
91/116 Image Segmentation
Introduction
Segmentation Techniques
Discontinuity Based Segmentation
Performance Evaluation
Similarity Based Segmentation
Color Image Segmentation
Conclusion
Region Growing
It is a procedure which groups the pixels or subregions into
larger region based on a defined predicate.
After selecting a set of points (seed) in the image, the
operation tries to grow the region staring from the seed point
incorporating all the points similar to the seed point.
Two points can be said similar if there intensity values are
very close.
Homogeneity Measure
Homogeneity property is to be satisfied by the gray levels of
pixels lying within a region.
The gray level variance of the pixels can be a metric for
homogeneity measurement and can be defined as
1 2
MH (R ) = f (x , y ) − f̄ (x , y ) ≤ T
|R |
(x ,y )∈R
where, |R | represents the size of region R in number of pixels
and T is the threshold. f̄ is the average gray value within R .
Another homogeneity property for a small range of gray levels
of pixels lying in a region can be defined as
max − min ≤ T
g (r ,c )∈R g (r ,c )∈R
Region Splitting
Quad Tree
Region Merging
K- means clustering
Xk ∈Ui Xk
vi = , (2)
| Ci |
4 Repeat step 2 and 3 until the updated centroid become stable.
Figure: K-Means
Subjective Evaluation
Subjective Evaluation
(a) Cell 1 (b) Ground Truth (c) Cell 2 (d) Ground Truth
Objective Evaluation
Conclusion
Important References I
1 Anil K. Jain.
Fundamentals of Digital Image Processing.
Prentice-Hall of India, 1989.