Chapter2 Segmentation
Chapter2 Segmentation
Segmentation
Goal:
AIBO
RoboSoccer
(VelosoLab)
Ideal Segmentation
can
recognize
objects
with
known ?
simple ?
color ?
models
Image Segmentation Techniques
❑Histogram-based thresholding
❑Region growing
6
METHODS OF EDGE DETECTION
Gy
The direction of the edge at location (x,y) is
perpendicular to the gradient vector at that point
Gradient
❑ Approximation of Gradient for a discrete
two dimensional function Gx f [i, j + 1] − f [i, j ]
❑ Convolution Mask
❑ Gx= Gy f [i, j ] − f [i + 1, j ]
-1 1 -1 1
❑ Gy =
1 -1 1
-1 1 1
❑ Differences are computed at the -1 -1
interpolated points [i, j+1/2] and [i+1/2, j]
10
Robert Operator
Sobel Operator
Sobel Operator - Example
14
Prewitt Operator
17
Second Order Derivative Methods
18
Second Order Derivative Methods - Laplacian
❑Defined as
❑Mask
0 1 0
1 -4 1
0 1 0
20
Laplacian of Gaussian – contd.
❑Defined as
21
Laplacian of Gaussian - contd.
• Also called the Mexican Hat operator
22
Laplacian of Gaussian – contd.
• Mask
23
Second Order Derivative Methods -
Difference of Gaussian - DoG
x 2+ y 2 x 2+ y 2
−( ) −( )
212
e 2 2
2
e
DoG ( x, y ) = −
2 1 2 2
2 2
24
Difference of Gaussian – contd.
Advantage of DoG
❑Close approximation of LoG
❑Less computation effort
❑Width of edge can be adjusted by changing s1 and s2
25
Canny Edge Detection
❑Low error rate
❑All true edges should be found
❑Edge points should be well localized Edges
should be located as close as possible to the true
edges
❑Single edge point response One point for each
true edge point No of local maxima around true
should be minimum
Canny Edge Detection Algorithm
❑Smooth image I with 2D Gaussian:
GI
❑Find local edge normal directions for each pixel
(G I )
n=
(G I )
❑Compute edge magnitudes
(G I )
❑Locate edges by finding zero-crossings along the edge
normal directions (non-maximum suppression)
2 (G I )
=0
n 2
Thresholding
28
Thresholding
Bi-level thresholding is employed on images which have
bimodal histograms.
In bi-level thresholding, the object and background form two
different groups with distinct gray levels.
A simple iterative algorithm for threshold selection in a bimodal image
Multilevel Thresholding
Region growing
1. Split (& merge) starts from the assumption that the entire
image is homogeneous
2. If this is not true (by the homogeneity criterion), the image is
split into four sub images
3. This split is repeated until no further splitting is possible
Split &
merge
Split & Split and merge
Split advantage:
Created regions are adjacent and homogenous
Split dis-advantage:
Over splitting since no merge is performed
Improvement::
Split &
merge
Split & Split and merge