Lecture 2: Edge detection
CS5670: Computer Vision
From Sandlot Science
Announcements
Project 1: Hybrid Images
Project 1 Demo
Reading
Edge detection
TexPoint fonts used in EMF.
Read the TexPoint manual before you delete this box.: AAA
Origin of edges
depth discontinuity
surface color discontinuity
illumination discontinuity
surface normal discontinuity
Images as functions…
Characterizing edges
image
intensity function�(along horizontal scanline)
first derivative
edges correspond to�extrema of derivative
Source: L. Lazebnik
Image derivatives
| | |
1 | -1 | |
| | |
How would you implement this as a linear filter?
| | |
| -1 | |
| 1 | |
:
:
Source: S. Seitz
Image gradient
The gradient points in the direction of most rapid increase in intensity���
The edge strength is given by the gradient magnitude:
The gradient direction is given by:
Source: Steve Seitz
Image gradient
Source: L. Lazebnik
Effects of noise
Where is the edge?
Source: S. Seitz
Noisy input image
Solution: smooth first
f
h
f * h
Source: S. Seitz
To find edges, look for peaks in
Associative property of convolution
f
Source: S. Seitz
The 1D Gaussian and its derivatives
2D edge detection filters
Gaussian
derivative of Gaussian (x)
Derivative of Gaussian filter
x-direction
y-direction
The Sobel operator
-1 | 0 | 1 |
-2 | 0 | 2 |
-1 | 0 | 1 |
1 | 2 | 1 |
0 | 0 | 0 |
-1 | -2 | -1 |
Sobel operator: example
Source: Wikipedia
Which method is the best way to compute the gradient of an image?
ⓘ Start presenting to display the poll results on this slide.
Example
original image
Image credit: Joseph Redmon
smoothed gradient magnitude
Finding edges
thresholding
Finding edges
where is the edge?
Get Orientation at Each Pixel
θ = atan2(gy, gx)
0
360
Gradient orientation angle
Non-maximum supression
Before Non-max Suppression
After Non-max Suppression
Thresholding edges
Connecting edges
Canny edge detector
Source: D. Lowe, L. Fei-Fei, J. Redmon
MATLAB: edge(image,‘canny’)
Canny edge detector
J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986.
: width of the Gaussian blur
high threshold
low threshold
Canny edge detector
Canny with
Canny with
original
Source: S. Seitz
Scale space [Witkin 83]
larger
Gaussian filtered signal
first derivative peaks
Questions?