05 Edges
05 Edges
Edge Detection
• Linear filtering:
– Form a new image whose pixels are a weighted sum of
original pixel values
– Use the same set of weights at each point
superposition property
𝑓 1,1 = 𝑓 1,1 ×1
= 𝑓[1,1]×𝛿[0,0]
? ?
𝑓 𝑛, 𝑚 = 𝑓 𝑛, 𝑚 ×1
= 𝑓[𝑛, 𝑚]×𝛿[0,0]
? ?
? ?
𝑓 𝑛, 𝑚 ∗ ∗ ℎ 𝑛, 𝑚 = < < 𝑓 𝑘, 𝑙 ℎ 𝑘 − 𝑛, 𝑙 − 𝑚
CAB? @AB?
Courtesy of J. Fessler
Stanford University Lecture 5 - 21 6-Oct-16
(Cross) correlation – example
Courtesy of J. Fessler
Stanford University Lecture 5 - 22 6-Oct-16
(Cross) correlation – example
Courtesy of J. Fessler
numpy’s
correlate
Stanford University Lecture 5 - 23 6-Oct-16
(Cross) correlation – example
Left Right
scanline
f*h f**h
Figure from “Computer Vision for Interactive Computer Graphics,” W.Freeman et al, IEEE Computer Graphics and Applications,
1998 copyright 1998, IEEE
• Associative property:
• Distributive property:
• Shift property:
• Shift-invariance:
viewpoint
Vanishing
line
Vanishing Vanishing
point point
Source: J. Hayes
depth discontinuity
illumination discontinuity
Source: D. Hoiem
Source: D. Hoiem
Depth discontinuity
Source: D. Hoiem
Source: D. Hoiem
Forward
Central
• Forward: [-1 1 0]
• Central: [ 1 0 -1]
• Forward: [-1 1 0]
edges correspond to
extrema of derivative
The gradient vector points in the direction of most rapid increase in intensity
Original Gradient
Image magnitude
x-direction y-direction
Intensity
Gradient
Source: D. Hoiem
f*g
d
( f * g)
dx
d
• To find edges, look for peaks in ( f * g)
dx Source: S. Seitz
d
g
dx
d
f* g
dx Source: S. Seitz
* [1 0 -1] =
2D-gaussian x - derivative
x-direction y-direction
• original image
Stanford University Lecture 5 - 94 10-Oct-17
Derivative of Gaussian filter
x-direction y-direction
Source: J. Hayes
Source: J. Hayes
𝛻𝐺 𝑥, 𝑦 𝛻𝐺 𝑥, 𝑦 > 𝛻𝐺 𝑥′, 𝑦′
𝛻𝐺 𝑥, 𝑦 > 𝛻𝐺 𝑥′′, 𝑦′′
Source: D. Forsyth
Before After
Stanford University Lecture 5 - 104 10-Oct-17
Canny edge detector
• Suppress Noise
• Compute gradient magnitude and direction
• Apply Non-Maximum Suppression
– Assures minimal response
• Use hysteresis and connectivity analysis to
detect edges
Source: S. Seitz
Color
Texture
Combined
Human