AIS412 - Lecture 2
AIS412 - Lecture 2
Lecture 3: Corner
Detection
MUSTAFA ELATTAR
2
Overview
• Why detect corners?
• Harris corner detector.
• Multi-scale detection.
• Multi-scale blob detection.
3
Why detect corners?
4
Why detect corners?
• Image alignment (homography, fundamental matrix)
• 3D reconstruction
• Motion tracking
• Object recognition
• Indexing and database retrieval
• Robot navigation
5
Planar object instance recognition
Database of planar objects Instance recognition
6
3D object recognition
Database of 3D objects 3D objects recognition
7
Recognition under occlusion
Location Recognition
9
Robot Localization
10
Image matching
11
NASA Mars Rover images
17
How do you find a corner?
18
How do you find a corner? [Moravec 1980]
19
Easily recognized by looking through a small window
[Moravec 1980]
Design a program to detect corners
(hint: use image gradients)
21
Finding corners
1.Compute image g r a d i e n t s o v e r
small region
3. Compute t h e c o v a r i a n c e m a t r i x
4. Compute e i g e n v e c t o r s and
eigenvalues
5 . U s e t h r e s h o l d on e i g e n v a l u e s t o
detect corners
(a.k.a. PCA)
22
1. Compute image gradients over a small region
(not just a single pixel)
array of x gradients
array of y gradients
23
visualization of gradients
image
X derivative
Y derivative
24
What does the distribution tell you about the region?
distribution reveals edge orientation and magnitude
How do you quantify orientation and magnitude?
2. Subtract the mean from each image gradient
plot intensities
constant intensity
gradient
28
2. Subtract the mean from each image gradient
plot intensities
constant intensity
gradient
subtract mean
data is centered 29
plot of image gradients
(‘DC’ offset is removed)
3. Compute the covariance matrix
=sum( * )
array of x gradients array of y gradients
30
4. Compute eigenvalues and eigenvectors
eigenvalue
eigenvector
31
Visualization as an ellipse
Since M is symmetric, we have
direction of the
fastest change
Ellipse equation:
direction of the
(λmax)-1/2 slowest change
(λmin)-1/2
32
Interpreting eigenvalues
λ2
λ2 >> λ1
λ1 >> λ2
λ1 33
Interpreting eigenvalues
λ2
‘horizontal’ corner
edge
λ2 >> λ1
λ 1 ~ λ2
flat λ1 >> λ2
‘vertical’
edge
λ1 34
Interpreting eigenvalues
λ2
‘horizontal’ corner
edge
λ2 >> λ1
λ 1 ~ λ2
flat λ1 >> λ2
‘vertical’
edge
λ1 35
Interpreting eigenvalues
λ2
‘horizontal’ corner
edge
λ2 >> λ1
λ 1 ~ λ2
flat λ1 >> λ2
‘vertical’
edge
λ1 36
5. Use threshold on eigenvalues to detect corners
λ2
Think of a function to
score ‘cornerness’
flat
37
λ1
5. Use threshold on eigenvalues to detect corners
λ2
strong corner
Think of a function to
score ‘cornerness’
flat
38
λ1
5. Use threshold on eigenvalues to detect corners
λ2
corner
flat
39
λ1
5. Use threshold on eigenvalues to detect corners
λ2
corner
Eigenvalues need to be
bigger than one.
flat
40
λ1
5. Use threshold on eigenvalues to detect corners
λ2
corner
R<0 R>0
R<0
flat
41
λ1
Harris & Stephens (1988)
Nobel (1998)
Harris Detector
C.Harris and M.Stephens. “A Combined Corner and Edge Detector.”1988.
43
Harris Detector
C.Harris and M.Stephens. “A Combined Corner and Edge Detector.”1988.
44
Yet another option:
Harris criterion
Corner response
Thresholded corner response
Non-maximal suppression
Harris corner response is invariant to rotation
54
Harris corner response is invariant to intensity changes
• Intensity scale: I → a I
R R
threshold
edge!
corner!
56
AIS412
Lecture 4: Feature
Detection
MUSTAFA ELATTAR
58
Overview
• Why do we need feature descriptors?
• Designing feature descriptors.
• MOPS descriptor.
• GIST descriptor.
59
Why do we need feature descriptors?
60
If we know where the good features are,
how do we match them?
Designing feature descriptors
63
What is the best descriptor for an image feature?
Photometric transformations
65
Geometric transformations
1 2 3
4 5 6 ( 1 2 3 4 5 6 7 8 9 )
vector of intensity values
7 8 9
1 2 3
4 5 6 ( - + + - - + )
vector of x derivatives
7 8 9
‘binary descriptor’
colors
71
MOPS descriptor
72
Multi-Scale Oriented Patches (MOPS)
Multi-Image Matching using Multi-Scale Oriented Patches. M. Brown, R. Szeliski and S. Winder.
International Conference on Computer Vision and Pattern Recognition (CVPR2005). pages 510-517
73
Multi-Scale Oriented Patches (MOPS)
Given a feature
Get 40 x 40 image patch, subsample every 5th pixel
(low frequency filtering, absorbs localization errors)
Subtract the mean, divide by standard deviation
(removes bias and gain)
Haar Wavelet Transform
(low frequency projection)
Multi-Image Matching using Multi-Scale Oriented Patches. M. Brown, R. Szeliski and S. Winder. 74
International Conference on Computer Vision and Pattern Recognition (CVPR2005). pages 510-517
Haar Wavelets
(actually, Haar-like features)
Use responses of a bank of filters as a descriptor
75
GIST descriptor
76
GIST Filter bank
77
Directional edge detectors
79
GIST Filter bank
Generalization power