Download presentation
Presentation is loading. Please wait.
Published byEthan Richards Modified over 8 years ago
1
Edge Detection Images and slides from: James Hayes, Brown University, Computer Vision course Svetlana Lazebnik, University of North Carolina at Chapel Hill, Computer Vision course D. Forsyth and J. Ponce. Computer Vision: A Modern Approach, Prentice Hall, 2011. R. Gonzalez and R. Woods. Digital Image Processing, Prentice Hall, 2008. T-11 Computer Vision University of Ioanina Christophoros Nikou
2
Edge detection Goal: Identify sudden changes (discontinuities) in an image. – Intuitively, most semantic and shape information from the image can be encoded in the edges. – More compact than pixels. Ideal: artist’s line drawing (artist also uses object-level knowledge) Source: D. Lowe
3
Origin of Edges Edges are caused by a variety of factors depth discontinuity surface color discontinuity illumination discontinuity surface normal discontinuity Source: Steve Seitz
4
Edge model
5
Edge point detection Magnitude of the first derivative. Sign change of the second derivative. Observations: Second derivative produces two values for an edge (undesirable). Its zero crossings may be used to locate the centres of thick edges.
6
The gradient points in the direction of most rapid increase in intensity Image gradient The gradient of an image: The gradient direction is given by how does this relate to the direction of the edge? The edge strength is given by the gradient magnitude Source: Steve Seitz
7
Differentiation and convolution Recall, for 2D function, f(x,y): This is linear and shift invariant. It is therefore the result of a convolution. Approximation: which is a convolution with the mask: 1 Source: D. Forsyth, D. Lowe
8
Finite differences: example
9
Effect of Finite Differences on White Noise Let f be an observed instance of the image f 0 corrupted by noise w : with noise samples having mean value E[w(n)]=0 and being uncorrelated with respect to location:
10
Effect of Finite Differences on White Noise Applying a filter h to the degraded image: The expected value of the output is: The noise is removed in average.
11
Effect of Finite Differences on White Noise What happens to the standard deviation of g ? Assume that a finite difference filter is used, which approximates the first derivative: 1
12
Effect of Finite Differences on White Noise For a second derivative approximation: 000 1-21 000 The standard deviation increases sharply! Higher order coefficients form a Pascal triangle.
13
Edge model and noise Intensity profileFirst derivativeSecond derivative
14
Edge model and noise Intensity profileFirst derivativeSecond derivative
15
Noise Edge detectors respond strongly to sharp changes and noise is a sharp change. Simple finite differences are unusable. Independent additive stationary Gaussian noise is the simplest model.
16
Issues with the Gaussian model this model allows noise values that could be greater than maximum camera output or less than zero. for small standard deviations, this isn’t too much of a problem - it’s 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).
17
Smoothing (e.g. average) kernels have Therefore, the noise standard deviation is reduced at the output, as we saw before. Also, after smoothing (e.g. average), noise samples are no longer independent. They look like their neighbors and the derivatives are smaller. Why smoothing helps
18
Noisy Edge Smoothing To find edges, look for peaks in f g f * g Source: S. Seitz
19
Convolution property f Source: S. Seitz Convolve with the derivative of the filter.
20
Derivative of Gaussian * [1 -1] =
21
Derivative of Gaussian (cont.) x-direction y-direction
22
Smoothed derivative removes noise but blurs edge. It also finds edges at different “scales” affecting the semantics of the edge. σ =1 Tradeoff between smoothing and localization Source: D. Forsyth σ =3 σ =7
23
Problems with gradient-based edge detectors σ =1σ =2 There are three major issues: 1. The gradient magnitude at different scales is different; which scale should we choose? 2. The gradient magnitude is large along thick trail; how do we identify only the significant points? 3. How do we link the relevant points up into curves?
24
Designing an optimal edge detector Criteria for an “optimal” edge detector [Canny 1986]: – Good detection: the optimal detector must minimize the probability of false positives (detecting spurious edges caused by noise), as well as that of false negatives (missing real edges). – Good localization: the edges detected must be as close as possible to the true edges – Single response: the detector must return one point only for each true edge point; that is, minimize the number of local maxima around the true edge. Source: L. Fei-Fei
25
Canny edge detector 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. J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986.A Computational Approach To Edge Detection Source: L. Fei-Fei
26
Canny edge detector (cont.) 1.Filter image with derivative of Gaussian. 2.Find magnitude and orientation of gradient. 3.Non-maximum suppression: – Thin multi-pixel wide “ridges” down to single pixel width. 4.Linking and thresholding (hysteresis): – Define two thresholds: low and high – Use the high threshold to start edge curves and the low threshold to continue them. Source: D. Lowe, L. Fei-Fei
27
Canny edge detector (cont.) original image
28
Canny edge detector (cont.) Gradient magnitude
29
Canny edge detector (cont.) Non-maximum suppression and hysteresis thresholding
30
Non-maximum suppression (cont.) Source: D. Forsyth We wish to mark points along the curve where the gradient 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 algorithmic issues: at which point is the maximum, and where is the next one?
31
Non-maximum suppression (cont.) At pixel q, we have a maximum if the value of the gradient magnitude is larger than the values at both p and at r. Interpolation provides these values. Source: D. Forsyth
32
Assume the marked point is an edge point. Then we construct the tangent to the edge curve (which is normal to the gradient at that point) and use this to predict the next points (here either r or s). Edge linking Source: D. Forsyth
33
Source: S. Seitz Use a high threshold to start edge curves and a low threshold to continue them. Hysteresis Thresholding (cont.)
34
Hysteresis thresholding (cont.) high threshold (strong edges) low threshold (weak edges) hysteresis threshold Source: L. Fei-Fei
35
Where do humans see boundaries? Berkeley segmentation database: http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/ http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/ image human segmentation gradient magnitude
36
D. Martin, C. Fowlkes and J. Malik. Learning to detect natural image boundaries using local brightness, color and texture cues. IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 26, No 5, pp. 530-549, 2004.Learning to detect natural image boundaries using local brightness, color and texture cues Learning to detect image boundaries Learn from humans which combination of features is most indicative of a “good” contour?
37
Feature profiles (oriented energy, brightness, color, and texture gradients) along the patch’s horizontal diameter D. Martin, C. Fowlkes and J. Malik. Learning to detect natural image boundaries using local brightness, color and texture cues. IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 26, No 5, pp. 530-549, 2004.Learning to detect natural image boundaries using local brightness, color and texture cues What features are responsible for perceived edges?
38
pB Boundary Detector Figure from Fowlkes
39
D. Martin, C. Fowlkes and J. Malik. Learning to detect natural image boundaries using local brightness, color and texture cues. IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 26, No 5, pp. 530-549, 2004.Learning to detect natural image boundaries using local brightness, color and texture cues What features are responsible for perceived edges? (cont.)
40
Results Human (0.95) Pb (0.88)
41
Results Human Pb Human (0.96) Global Pb Pb (0.88)
42
Human (0.95) Pb (0.63)
43
Human (0.90) Pb (0.35) For more: http://www.eecs.berkeley.edu/Research/Projects /CS/vision/bsds/bench/html/108082-color.html http://www.eecs.berkeley.edu/Research/Projects /CS/vision/bsds/bench/html/108082-color.html
44
45 years of boundary detection Source: Arbelaez, Maire, Fowlkes, and Malik. TPAMI 2011 (pdf)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.