Download presentation
Presentation is loading. Please wait.
Published byBrian Gilbert Modified over 8 years ago
1
Computer Vision Spring 2012 15-385,-685 Instructor: S. Narasimhan WH 5409 T-R 10:30 – 11:50am
2
Edge Detection Lecture #6
3
Edge Detection Convert a 2D image into a set of curves –Extracts salient features of the scene –More compact than pixels
4
Origin of Edges Edges are caused by a variety of factors depth discontinuity surface color discontinuity illumination discontinuity surface normal discontinuity
5
Edge Types Step Edges Roof Edge Line Edges
6
Real Edges Noisy and Discrete! We want an Edge Operator that produces: –Edge Magnitude –Edge Orientation –High Detection Rate and Good Localization
7
Gradient Gradient equation: Represents direction of most rapid change in intensity Gradient direction: The edge strength is given by the gradient magnitude
8
Theory of Edge Detection Ideal edge Unit step function: Image intensity (brightness):
9
Partial derivatives (gradients): Squared gradient: Edge Magnitude: Edge Orientation: Rotationally symmetric, non-linear operator (normal of the edge) Theory of Edge Detection
10
Image intensity (brightness): Partial derivatives (gradients): Laplacian: Rotationally symmetric, linear operator zero-crossing Theory of Edge Detection
11
Discrete Edge Operators How can we differentiate a discrete image? Finite difference approximations: Convolution masks :
12
Second order partial derivatives: Laplacian : Convolution masks : or Discrete Edge Operators (more accurate)
13
The Sobel Operators Better approximations of the gradients exist –The Sobel operators below are commonly used 01 -202 01 121 000 -2
14
Comparing Edge Operators 01 01 01 111 000 1 Gradient: Roberts (2 x 2): Sobel (3 x 3): Sobel (5 x 5): -2021 -3032 -5053 -2-3032 -2021 12321 23532 00000 -3-5-3-2 -2-3-2 01 0 10 0 Good Localization Noise Sensitive Poor Detection Poor Localization Less Noise Sensitive Good Detection
15
Effects of Noise Consider a single row or column of the image –Plotting intensity as a function of position gives a signal Where is the edge??
16
Where is the edge? Solution: Smooth First Look for peaks in
17
Derivative Theorem of Convolution … saves us one operation.
18
Laplacian of Gaussian (LoG) Laplacian of Gaussian operator Where is the edge? Zero-crossings of bottom graph ! Laplacian of Gaussian
19
2D Gaussian Edge Operators Laplacian of GaussianGaussianDerivative of Gaussian (DoG) Mexican Hat (Sombrero) is the Laplacian operator:
20
Canny Edge Operator Smooth image I with 2D Gaussian: Find local edge normal directions for each pixel Compute edge magnitudes Locate edges by finding zero-crossings along the edge normal directions (non-maximum suppression)
21
Non-maximum Suppression Check if pixel is local maximum along gradient direction –requires checking interpolated pixels p and r
22
The Canny Edge Detector original image (Lena)
23
magnitude of the gradient The Canny Edge Detector
24
After non-maximum suppression The Canny Edge Detector
25
Canny Edge Operator Canny with original The choice of depends on desired behavior –large detects large scale edges –small detects fine features
26
Difference of Gaussians (DoG) Laplacian of Gaussian can be approximated by the difference between two different Gaussians
27
DoG Edge Detection (a)(b)(b)-(a)
28
Gaussian – Image filter Gaussian delta function Fourier Transform
29
Unsharp Masking – = = + a
30
MATLAB demo g = fspecial('gaussian',15,2); imagesc(g) surfl(g) gclown = conv2(clown,g,'same'); imagesc(conv2(clown,[-1 1],'same')); imagesc(conv2(gclown,[-1 1],'same')); dx = conv2(g,[-1 1],'same'); imagesc(conv2(clown,dx,'same'); lg = fspecial('log',15,2); lclown = conv2(clown,lg,'same'); imagesc(lclown) imagesc(clown +.2*lclown)
31
Edge Thresholding Standard Thresholding: Can only select “strong” edges. Does not guarantee “continuity”. Hysteresis based Thresholding (use two thresholds) Example: For “maybe” edges, decide on the edge if neighboring pixel is a strong edge.
32
Edge Relaxation Parallel – Iterative method to adjust edge values on the basis of neighboring edges. No Edge Edge Edge to be updated a b c e h f g Vertex Types: (0) (1)
33
Edge Relaxation Vertex Types (continued): (2) (3)
34
Edge Relaxation Algorithm Action Table:Decrement Increment Leave as is Edge Type 0 - 0 0 - 2 0 - 3 1 - 1 1 - 2 1 - 3 0 - 1 2 - 2 2 - 3 3 - 3 Algorithm: Step 0: Compute Initial Confidence of each edge e : Step 1: Initialize Step 2: Compute Edge Type of each edge e Step 3: Modify confidence based on and Edge Type Step 4: Test to see if all have CONVERGED to either 1 or 0. Else go to Step 2.
35
Edge Relaxation
36
Next Class Boundary Detection and Hough Transform
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.