Lecture-4-Edge-detection-Part-I (2)
Lecture-4-Edge-detection-Part-I (2)
Computer Vision
Yogesh S Rawat
[email protected]
HEC-241
Lecture 4
depth discontinuity
illumination discontinuity
intensity function
image (along horizontal scanline) first derivative
edges correspond to
9/14/2021 Slide Credit: James Hays Lecture 3 –Edge Detection extrema of derivative 12
Intensity profile
Intensity
Intensity derivative
Intensity derivative x
f*g
d
( f g)
dx
d
To find edges, look for peaks in ( f g)
dx
9/14/2021 Lecture 3 –Edge Detection 17
Source: S. Seitz
Derivative theorem of convolution
d d
• Convolution is differentiable: ( f g) = f g
dx dx
• This saves us one operation:
d
g
dx
d
f g
dx
df
= f ( x) − f ( x − 1) = f ( x) Backward difference
dx
df
= f ( x) − f ( x + 1) = f ( x) Forward difference
dx
df
= f ( x + 1) − f ( x − 1) = f ( x) Central difference
dx
Gradient magnitude f ( x, y) = f x2 + f y2
fx
Gradient direction = tan −1
fy
a. Original image
b. Laplacian operator
c. Horizontal derivative
d. Vertical derivative
average derivative
image smoothing in y blurred filtering in y edges in y
1 1 1 1 1 1 1
1 1 1 −1 0 0 0
and
− 1 − 1 − 1
Sobel Edge Detector
average derivative
image smoothing in x blurred filtering in x edges in x
1 1
2 2 1 −1
and
1 1 1 0 − 1
2 0 − 2
1 0 − 1
average derivative
image smoothing in y blurred filtering in y edges in y
1 2 1 1 1 2 1
1 2 1 −1 0 0 0
and
− 1 − 2 − 1
Sobel Edge Detector
1 0 − 1
2 0 − 2 d
I
1 0 − 1 dx
*
Threshold Edges
Image I d d
2
I + I
2
dx dy
1 1 d
* 2 I
0 0 0 dy
− 1 − 2 − 1
Sobel Edge Detector
d
I
dx
d
I
dy
Sobel Edge Detector
2
d d
2
= I + I
dx dy
Threshold = 100
Sobel vs Prewitt
Sources for this lecture include materials from works by Mubarak Shah,
Abhijit Mahalanobis, and D. Lowe
Other sources from James Hays, Lana Lazebnik, Steve Seitz, David Forsyth, David Lowe, Fei-Fei Li, and Derek Hoiem