Edge and Corner Detection
Basics
2
Digital derivatives: first versus second
3
4
Digital derivatives: first versus second
Laplacian of an image
5
Laplacian operators: second operator is obtained by adding second derivatives along both the diagonals, to the first operator
Rotationally symmetric operator (in the continuous domain)
6
From book by Gonzalez and Woods
Intensity discontinuity, also called step edge
Edge detection under noise
7
First and second derivatives are very sensitive to noise!
Left to right in each row: original image, first derivative, second derivative
In any column: increase in noise level
Steps in robust edge detection
8
Edge detection: image gradient
9
Robust edge operators
10
These operators: Prewitt and Sobel perform some smoothing prior to difference computation, and hence are more robust than the simple finite differences from the previous slide.
Prewitt and Sobel
11
12
Original image
Derivatives in y direction: fy
Derivatives in x direction: fx
| fx | + |fy|
Edges with Sobel Mask
13
Original image
Derivatives in y direction: fy
Derivatives in x direction: fx
|fx | + |fy|
Edges with 5 x 5 averaging followed by Sobel Mask
Notice: finer details removed
14
Edge map after Thresholding the earlier map.
Marr-Hildreth edge detector
15
Laplacian of Gaussian (LoG or Mexican hat)
16
17
Why LoG for edge detection?
18
Using LoG for edge detection
19
Implementing the convolution
20
Use an n x n mask, created by sampling the formula for LoG on a discrete Cartesian crid of size n x n.
How to choose n? Depends on σ: n should be >= 6σ, because more than 99% of the volume underneath a 2D Gaussian lies between μ-3σ and μ+3σ.
Finding zero-crossings
21
(x,y)
22
σ = 4, n = 25
Convolut-ion with LoG
Zero-crossings
Zero-crossings + thresholding
Some properties of the Marr-Hildreth Edge Detector
23
Canny Edge Detector: using 1st derivatives
Canny’s detector was formulated by analyzing step edges in 1D under zero-mean i.i.d. Gaussian noise, and expressing the preceding three criteria mathematically and deriving an (approximate) operator that obeys all criteria.
24
Canny’s Edge Detector
25
Canny’s Edge Detector
26
Canny edge detector
27
Canny edge detector
28
Canny Edge Detector
-M(x,y) > TH, OR
-M(x,y) > TL AND (x,y) is a neighbor of at least one pixel with M(x,y) > TH.
29
(x,y)
The 8 neighbors of pixel (x,y)
Summary: Canny Edge detector
(2) Perform non-maximal suppression.
(3) Perform hysteresis thresholding.
30
31
32
33
Gaussian filtered (sigma = 1.4, 5 x 5 mask)
Intensity gradients superimposed
Non-maximum suppression
Double thresholding (TL = 0.1, TH = 0.3)
After edge-linking (hysteresis)
Corner Detection
Importance of corners
35
36
Importance of corners
37
38
Good patch for matching
Bad patch for matching
Importance of corners
39
40
Ambiguity in point matching in flat intensity regions or along edges
Principle behind Harris corner detector
41
42
Structure tensor matrix (size 2 x 2)
Principle behind Harris corner detector
43
Proof that the structure tensor matrix is positive semi-definite: Method 1
44
Any matrix that can be written in the form A = ZZ^T is always positive semi-definite (quoting a result from linear algebra)
Proof that the structure tensor matrix is positive semi-definite: Method 2
45
Principle behind Harris corner detector
46
“Corner”-ness measure
RH = det(A) – k (trace(A))2, k between 0.04 to 0.06
50
52
Computing corners
53
54
55
56
57
58
Invariance
59
Other measures of corner-ness
60