2e. Edge Detection
2e. Edge Detection
Origin of Edges
depth discontinuity
illumination discontinuity
-4-
-5-
Laplacian
• Isotropic filter: independent of the direction rotation
invariant
Development of the method
• Lapacian: simplest isotropic derivative operator, Linear
operator
2 2 f 2 f
f 2 2
x y
2 f
x direction : f ( x 1, y ) f ( x 1, y ) 2 f ( x, y )
x 2
2 f
y direction : f ( x, y 1) f ( x, y 1) 2 f ( x, y )
y 2
-6-
• 2-D Laplacian is obtained by summing two components
2 f f ( x 1, y ) f ( x 1, y ) f ( x, y 1) f ( x, y 1) 4 f ( x, y )
-7-
• Adding the original and Laplacian images (superimpose)
f ( x, y ) 2 f ( x, y ) if the center coefficient of the
Laplacian mask is negative
g ( x, y ) 2
f ( x, y ) f ( x, y ) if the center coefficient of the
Laplacian mask is positive
g ( x, y ) f ( x, y ) f ( x 1, y ) f ( x 1, y ) f ( x, y 1) f ( x, y 1) 4 f ( x, y )
5 f ( x, y ) f ( x 1, y ) f ( x 1, y ) f ( x, y 1) f ( x, y 1)
-8-
-9-
Effects of noise
Consider a single row or column of the image
• Plotting intensity as a function of position gives a signal
Laplacian of Gaussian
operator
Laplacian of Gaussian
* [1 -1] =
Tradeoff between smoothing and localization
Source: D. Forsyth
Designing an edge detector
• Criteria for a good edge detector:
– Good detection: the optimal detector should find all real edges,
ignoring noise or other artifacts
– Good localization
• the edges detected must be as close as possible to
the true edges
• the detector must return one point only for each true
edge point
• Cues of edge detection
– Differences in color, intensity, or texture across the boundary
– Continuity and closure
Source: L. Fei-Fei
Canny edge detector
• This is probably the most widely used edge detector
in computer vision
• Theoretical model: step-edges corrupted by additive
Gaussian noise
• Canny has shown that the first derivative of the
Gaussian closely approximates the operator that
optimizes the product of signal-to-noise ratio and
localization
Source: L. Fei-Fei
Example
x-direction y-direction
Compute Gradients (DoG)
Source: D. Forsyth
Edge linking
Source: D. Forsyth
Bilinear Interpolation
Before Non-max Suppression
After non-max suppression
Before Non-max Suppression
After non-max suppression
Hysteresis thresholding
Threshold at low/high levels to get weak/strong edge
pixels
Do connected components, starting from strong edge
pixels
Hysteresis thresholding
Check that maximum value of gradient value is
sufficiently large
• drop-outs? use hysteresis
– use a high threshold to start edge curves and a low threshold to
continue them.
Source: S. Seitz
Final Canny Edges
Canny edge detector
1. Filter image with x, y derivatives of Gaussian
2. Find magnitude and orientation of gradient
3. Non-maximum suppression:
• Thin multi-pixel wide “ridges” down to single pixel
width
4. Thresholding and linking (hysteresis):
• Define two thresholds: low and high
• Use the high threshold to start edge curves and the
low threshold to continue them
Source: S. Seitz
Where do humans see boundaries?
image human segmentation gradient magnitude