Segment 5
Segment 5
Segment 5
R T
where T : a nonnegativ e threshold
f
x
gx
f grad ( f )
g y f
y
Detection of Discontinuities
Edge Detection
M ( x, y ) mag (f ) g x2 g y2
gy
( x, y ) tan
1
gx
Detection of Discontinuities
Gradient Operators
Prewitt operators
Sobel operators
Detection of Discontinuities
Gradient Operators
f G x G y
Consider a single row or column of the
image
◦ Plotting intensity as a function of position
gives a signal
Laplacian of Gaussian
operator
2
2
2
2 S 2 S 2 S
x y
2 S 2 G * I 2G * I
x2 y2
1 2
x y 2
G
2
2 e 2 2
2 3 2
derivative of Gaussian
Laplacian of Gaussian
Gaussian
2 2
Y
0.0008 0.0066 0.0215 0.031 0.0215 0.0066 0.0008
0.0066 0.0438 0.0982 0.108 0.0982 0.0438 0.0066
0.0215 0.0982 0 -0.242 0 0.0982 0.0215 X
0.031 0.108 -0.242 -0.7979 -0.242 0.108 0.031
0.0215 0.0982 0 -0.242 0 0.0982 0.0215
0.0066 0.0438 0.0982 0.108 0.0982 0.0438 0.0066
0.0008 0.0066 0.0215 0.031 0.0215 0.0066 0.0008
Image I 2G * I Edge Image
2 Zero Crossings
* G
Detection
3
6
Region Growing
1 0 5 6 7
1 1 5 8 7
0 1 6 7 7
2 0 7 6 6
Connectivity:
Region
Growing
1 0 5 6 7
1 1 5 8 7
0 1 6 7 7
2 0 7 6 6
Thresholding
255
O
u
t
p
u
t
s
0 30
255 input r
Graph for T=30
0 f ( x, y ) T
g ( x, y )
1 f ( x, y ) T
Due to the severe illumination gradient across the scene, the peaks
corresponding to foreground and background have run together and
so simple thresholding does not give good results. Following images
show the resulting bad segmentations for single threshold values of
80 and 120 respectively (reasonable results can be achieved by using
adaptive thresholding on this image).
No. of pixels with
background are
very very small so
its contribution in
histogram is
Negligible so instead
Subdivide this region further and find
of bimodal histogram
threshold for each sub- subregion it shows single peak
and hence does not
Satisfactory results show good results for
this particular
subimage
For
implementation
0=0
Dark object on a +=128
-=255
bright background
Dark object on a
bright background
The neighborhood
size for this
example is 7×7 and
C = 4). The result
shows that, in this
application, the
median is a less
suitable statistic
than the mean.
Consider another example image containing a strong
illumination gradient
2
• Compute x and y derivatives
T
S S
S Sx Sy
T
x y
• Compute gradient magnitude and orientation
S S x2 S y2
Sy
tan 1
Sx
I Sx
Sy
Canny Edge
Detector
S S x2 S y2
S Threshold 25
• We wish to mark points along the curve
where the magnitude is highest.
• We can do this by looking for a maximum
along a slice normal to the curve (non-
maximum suppression).
• There are then two algorithmic issues: at
which point is the maximum, and where is
the next one?
Suppress the pixels in ‘Gradient Magnitude Image’ which are not
local maximum
if S x, y S x , y
S x, y
M x, y & S x, y S x , y
x, y
0 otherwise
x, y
x,y and x,y are the neighbors of x,y in S
x, y along the direction normal to an edge
Non-Maximum
Suppression
S S x2 S y2
M Threshold 25
Hysteresis Thresholding
High 35
Low 15