Professional Documents
Culture Documents
Chapter 10:
2
Image Segmentation
• Segmentation algorithms generally are based
on one of two basis properties of intensity
values
• Discontinuity: to partition an image based
on abrupt changes in intensity (such as
edges)
3
Image Segmentation
Image Segmentation
4
Image Segmentation
Image Segmentation
5
Image Segmentation
Detection of discontinuities:
There are three basic types of gray-level
discontinuities:
points , lines , edges
6
Point Detection:
• Note that the mark is the same as the mask of
Laplacian Operation (in chapter 3)
|R| >T
7
Point Detection:
8
Line Detection
R1 R2 R3 R4
9
Line Detection
• Apply every masks on the image
• let R1, R2, R3, R4 denotes the response of
the horizontal, +45 degree, vertical and -45
degree masks, respectively.
• if, at a certain point in the image
|Ri| > |Rj|, for all j≠i,
• that point is said to be more likely
associated with a line in the direction of
mask i.
10
Line Detection
• Alternatively, if we are interested in detecting all
lines in an image in the direction defined by a
given mask, we simply run the mask through the
image and threshold the absolute value of the
result.
• The points that are left are the strongest
responses, which, for lines one pixel thick,
correspond closest to the direction defined by
the mask.
11
Line Detection
12
Edge Detection Approach
Segmentation by finding pixels on a region
boundary.
13
Edge Detection
14
Edge Detection
15
Edge Detection
16
Edge Detection
17
Edge Detection
Detection of discontinuities: Image Derivatives
18
Edge Detection
• First column: images and gray-
level profiles of a ramp edge
corrupted by random Gaussian
noise of mean 0 and = 0.0,
0.1, 1.0 and 10.0, respectively.
• Second column: first-derivative
images and gray-level profiles.
• Third column : second-
derivative images and gray-
level profiles.
19
Edge Detection
Gradient Operator
f
G x x
f f
G y
y
f G G 2
x
2 1/ 2
y
for 3 3 mask
Gx (z 7 z8 z9 ) (z1 z2 z3 )
G y (z 3 z6 z9 ) (z1 z4 z7 )
20
Edge Detection
Prewitt and Sobel Operators
21
Edge Detection
22
Edge Detection
23
Edge Detection
24
Edge Detection
25
Edge Detection
The Laplacian
26
Edge Detection
27
Edge Detection
The Laplacian of Gaussian (LoG)
28
Edge Detection
The Laplacian of Gaussian (LoG)
29
The Hough Transform
30
The Hough Transform
Global processing: The Hough Transform
31
The Hough Transform
Global processing: The Hough Transform
32
The Hough Transform
Global processing: The Hough Transform
33
Region-Based Segmentation
34
What is a Region?
Basic definition :- A group of
connected pixels with similar
properties.
35
Basic formulation of Region
36
What is a Region?
Basic definition :- A group of
connected pixels with similar
properties.
37
Region-Based vs. Edge-Based
Region-Based Edge-Based
Closed boundaries Boundaries formed
not necessarily
closed
Multi-spectral No significant
images improve improvement for
segmentation multi-spectral images
Computation based Computation based
on similarity on difference
36
Region based algorithm
Region Growing
- An initial set of small areas are iteratively merged according to
similarity constraints.
- Start by choosing an arbitrary seed pixel and compare it with
neighbouring pixels.
- Region is grown from the seed pixel by adding in neighbouring
pixels that are similar, increasing the size of the region.
- When the growth of one region stops we simply choose another
seed pixel which does not yet belong to any region and start again.
39
Region based algorithm
Region splitting and merging
40
Image Thresholding
•What is thresholding?
•Simple thresholding
•Adaptive thresholding
41
Thresholding – A Key Aspect
42
Automatic Thresholding
Use of one or more of the following:-
1. Intensity characteristics of objects
2. Sizes of objects
3. Fractions of image occupied by objects
4. Number of different types of objects
Size and probability of occurrence – most
popular
Intensity distributions estimate by
histogram computation.
43
Automatic Thresholding Methods
44
Thresholding Methods
P-tile Method:- If object
occupies P% of image pixels
then set a threshold T such
that P% of pixels have
intensity below T.
Iterative Thresholding:-
Successively refines an
approx. threshold to get a
new value which partitions T
1
2
1
the image better. 2
41
P-Tile Thresholding
• Thresholding is usually the first
step in any segmentation approach
• Single value thresholding can be
given mathematically as
follows:
if f (x, y)
g(x, y) T
0
1
if f (x, y) 46
P-Tile Thresholding
• Basic global thresholding:
• Based on the histogram of an image
Partition the image histogram using
a single global threshold
47
P-Tile Thresholding
• Basic global thresholding:
• The success of this technique very
strongly depends on how well the
histogram can be partitioned
48
Iterative P-Tile Thresholding
• The Basic global thresholding:
1. Select an initial estimate for T (typically the
average grey level in the image)
2. Segment the image using T to produce two
groups of pixels: G1 consisting of pixels with
grey levels >T and G2 consisting pixels with
grey levels ≤ T
3. Compute the average grey levels of pixels
in G1 to give μ1 and G2 to give μ2
49
Iterative P-Tile Thresholding
• The Basic global thresholding:
4. Compute a new threshold value:
T
1 2
2
5. Repeat steps 2 – 4 until the difference in T
in successive iterations is less than a
predefined limit T∞
This algorithm works very well for finding thresholds
when the histogram is suitable.
50
P-Tile Thresholding
51
P-Tile Thresholding
52
P-Tile Thresholding
• Limitation of P-Tile thresholding:
53
P-Tile Thresholding
• Limitation of P-Tile thresholding:
54
P-Tile Thresholding
• Limitation of P-Tile thresholding:
55
Adaptive Thresholding
Adaptive Thresholding is used in scenes with
uneven illumination where same threshold
value not usable throughout complete image.
In such case, look at small regions in the
image and obtain thresholds for individual
sub-images. Final segmentation is the union
of the regions of sub-images.
56
Adaptive Thresholding
Thresholding – Basic Adaptive Thresholding
57
Adaptive Thresholding
Thresholding – Basic Adaptive Thresholding
58
Adaptive Thresholding
Thresholding – Basic Adaptive Thresholding
59
Adaptive Thresholding
Thresholding – Basic Adaptive Thresholding
60
Adaptive Thresholding
Thresholding – Basic Adaptive Thresholding
61
Connected Components
8-connectivity
Connectivity (2D)
Connected component
A maximum set of pixels (voxels) in the object or
background, such that any two pixels (voxels) are
connected via a path of connected pixels (voxels)
8-connectivity 4-connectivity
Connectivity (2D)
Can we use arbitrary connectivity for object and
background?
1. …
2. Repeat until Q is empty:
1. Pop a pixel x from Q.
2. For each unvisited object pixel y connected to x, add y
to S, set its flag to be visited, and push y to Q.
3. Output S
Finding Connected Components
Labeling all components in an image:
Loop through each pixel (voxel). If it is not labeled, find
its connected component, then label all pixels (voxels) in
the component.
Two
One components
component
73