Image Segmentation
Image Segmentation
Image Feature
Classification
Segmentation Extraction
Objec
Input
Object Image Feature Vector t Type
Image
Why segmentation is difficult ?
R T
where T : a nonnegativ e threshold
After
Result of
processing
thresholding
with -45°
filtering
line detector
result
Edge Detection
An edge is a set of connected pixels that lie
on the boundary between two regions
Edges & Derivatives
Prewitt operators
Sobel operators
Detection of Discontinuities
Gradient Operators
r2 The Laplacian of a
2 r 2 2
2 2 Gaussian (LoG)
h(r ) e
4
• 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.
Detection of Discontinuities
Gradient Operators
Edge Detection (overview)
28
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
f ( x, y ) ( x0 , y0 ) E , E : a nonnegativ e threshold
( x, y ) ( x0 , y0 ) A, A : a nonegative angle threshold
Edge Linking and Boundary
Detection Local Processing:
In this example, we canExample
find the license plate candidate after
edge linking process.
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)
yi axi b
(a)xy-plane
(b)Parameter
Space
(a) (b)
Edge Linking and Boundary
Detection Global Processing via the
Hough Transform
• The Hough transform
consists of finding all pairs of
values of and which x cos y sin
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.
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
Infrared Threshold
image. ed
gradient
Hough Linked
transfo pixels.
rm.
Thresholding
Computer Histogram of
generated reflectance
reflectance function
function
Thresholding
The Role of Illumine
(a)Computer
generated
reflectance
function.
(b)Computer
r ( x, y ) (a) (b) i ( x, y ) generated
illumination
(c) (d) function
(c)Product of
(a) and (b)
(d)Histogram
of product
image
f ( x, y ) i ( x, y )r ( x, y )
Thresholding: Algorithm
Original
Image
Image Histogram
Result of
global
thresholding
with T midway
between the
maximum and
minimum gray
levels.
Thresholding
Basic Global Thresholding
Image Histogram
Original
Image
Result of
segmentation
with the
threshold
estimated by
iteration.
Adaptive Thresholding Algorithm
Original Result of
Image global
thresholding
Image
Subdivided
into Result of
individual adaptive
subimage thresholding
.
Thresholding
Basic Adaptive Thresholding
How to solve this problem?
Properly and
Corresponding
improperly
histograms
segmented
subimage
Thresholding
Basic Adaptive Thresholding
Answer: subdivision
Histogram Further
Result of
of small subdivision of
adaptively
subimage the
segmenting.
at top, left improperly
segmented
subimage
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.
Gray-level
probability
density
functions
of two
regions in
an image
Thresholding
Use of Boundary Characteristics
Original
Image
Image
segmented by
local
thresholding
Thresholding
Thresholds Based on Several
Variables
Image
showing Seed
defectiv Points
e welds
Result of Boundaries
region of
growing. segmented
defective
welds (in
black)
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.)
56
Region Based Segmentation
SRG
• Advantage:
– With good connectivity
• Disadvantage:
– Initial seed-points:
• different sets of initial seed-point cause
different segmented result
– Time-consuming problem
57
Region Based Segmentation
USRG
• Unseeded region growing:
– no explicit seed selection is necessary,
the seeds can be generated by the
segmentation procedure automatically.
– It is similar to SRG except the choice of
seed point
58
Region Based Segmentation
USRG
• Advantage:
– easy to use
– can readily incorporate high level
knowledge of the image composition
through region threshold
• Disadvantage:
– slow speed
59
Region Based Segmentation
Fast Scanning
• Fast scanning
Algorithm:
– The fast scanning
algorithm somewhat
resembles unseeded
region growing
– the number of clusters
of both two algorithm
would not be decided
before image passing
through them.
60
Region Based Segmentation
Fast Scanning
61
Region Based Segmentation
Fast Scanning
• Last step:
62
Region Based Segmentation
Fast Scanning
• Advantage:
– The speed is very fast
– The result of segmentation will be intact
with good connectivity
• Disadvantage:
– The matching of physical object is not
good
• It can be improved by morphology and
geometric mathematic
63
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
Original image Topographic
view
Final watershed
Longer (segmentation)
dams. lines.
Segmentation by Morphological
Watersheds
Example
Image gradient
Image of
blobs
Watershed lines
Watershed superimposed
lines on original
image
The Use of Motion in Segmentation
• Document images
consist of texts,
graphics, photos and
so on
• Document
segmentation is
useful for
compression, text
recognition
• Adobe and Xerox are
the major players
70
Medical Image Segmentation
• Medical image
analysis can be used
as preliminary
screening
techniques to help
doctors
• Partial Differential
Equation (PDE) has
been used for
segmenting medical
images
active contour model (snake)
71
Range Image Segmentation
72
Biometric Image Segmentation
74