Title: ECE 549CS 543: COMPUTER VISION LECTURE 26
1ECE 549/CS 543 COMPUTER VISION LECTURE 26 EDGE
DETECTION
The edge detection problem Filtering and edge
detection in one dimension Convolution,
smoothing, and noise Gradient-based edge
detection Canny edge detector (1983)
Marr-Hildreth edge detector (1980)
- Reading Chapters 7 and 8
- Homework, due tomorrow
- http//www-cvr.ai.uiuc.edu/ponce/hw5/hw5.pdf
2The edge detection problem
3(No Transcript)
4Convolution
Linear filters Weighted averages
- Represent the weights by a rectangular array F.
- Applying the filter to an image G is equivalent
to - performing a convolution
- Rij (FG)ij ?u,v Gi-u, j-v Fu, v
- In the continuous case
- (f g) (x,y) su,v f(x-u,y-v) g(u,v) du dv
- Note fggf.
5Example Smoothing by Averaging
6Smoothing with a Gaussian
f(x,y)(1/2??2)exp-(x2y2)/2?2
7Smoothing with a Gaussian
8Noise
- Issues
- this model allows noise values that could be
greater than maximum camera output or less than
zero - for small standard deviations, this isnt too
much of a problem it is a fairly good model - independence may not be justified (e.g. damage to
lens) - may not be stationary (e.g. thermal gradients in
the ccd).
- Simplest noise model
- independent stationary additive Gaussian noise
- the noise value at each pixel is given by an
independent draw from the same normal probability
distribution.
9?1
10?16
11(No Transcript)
12Finite differences
13Finite differences and noise
- What is to be done? Intuitively, most pixels look
a lot like their neighbours - this is true even at an edge along the edge they
are similar, across the edge they arent - this suggests that smoothing the image should
help, by forcing pixels different from their
neighbors (noise pixels?) to look more like
neighbors.
- Finite difference filters respond strongly to
noise - obvious reason image noise results in pixels
that look very different from their neighbors - generally, the larger the noise the stronger the
response.
14Finite differences responding to noise
Increasing zero-mean Gaussian noise
15Smoothing and Differentiation
- Smooth before differentiation
- Two convolutions to smooth, then differentiate?
- Actually, no - we can use a derivative of
Gaussian filter - ( fg )f g
161 pixel
3 pixels
7 pixels
The scale of the smoothing filter affects
derivative estimates, and also the semantics of
the edges recovered.
17Gradient-based edge detection
There are three major issues 1) The gradient
magnitude at different scales is different which
should we choose? 2) The gradient
magnitude is large along thick trails how
do we identify the significant points? 3) How
do we link the relevant points up into curves?
18We wish to mark points along the curve where the
magnitude is biggest. We can do this by looking
for a maximum along a slice normal to the
curve (non-maximum suppression). These points
should form a curve. There are then two main
issues at which point is the maximum, and which
minima should we keep?
19Non-maximum suppression
At q, we have a maximum if the value is larger
than those at both p and at r. Interpolate to get
these values.
20Which local maxima should we keep?
- Those above a threshold T
- Those above L that are connected to a
- local maximum above H (thresholding
- with hysteresis)
21The edge detection problem
22(No Transcript)
23(No Transcript)
24(No Transcript)
25The Laplacian of Gaussian (Marr-Hildreth 80)
- Bad idea to apply a Laplacian without smoothing
- Smooth with Gaussian, apply Laplacian.
- This is the same as filtering with a Laplacian of
Gaussian filter. - Now mark the zero points where there is a
sufficiently large derivative, and enough
contrast.
- Another way to detect an extremal first
derivative is to look for a zero second
derivative. - Appropriate 2D analogy is rotation invariant
- the Laplacian
- r2 f?2f/?x2?2f/?y2
26The Laplacian of a Gaussian
27sigma4
contrast1
contrast4
LOG zero crossings
sigma2
28We have unfortunate behaviour at corners