Interest Points: Computer Vision Jia-Bin Huang, Virginia Tech
Interest Points: Computer Vision Jia-Bin Huang, Virginia Tech
Computer Vision
Jia-Bin Huang, Virginia Tech
Many slides from N Snavely, K. Grauman & Leibe, and D. Hoiem
Administrative Stuffs
• HW 1 posted, due 11:59 PM Sept 25
• Submission through Canvas
2. Registration
3. Registration
Takeo Kanade (CMU)
Example: automatic panoramas
x x
x
• Corner detection
• Feature matching
Why extract features?
• Motivation: panorama stitching
• We have two images – how do we combine them?
Why extract features?
• Motivation: panorama stitching
• We have two images – how do we combine them?
by Diva Sian
by swashford
Harder case
A2 A3
B2
B1
Detection
Description
Horizontal edge:
v
u
E(u,v)
Vertical edge:
v
u
General case
The shape of H tells us something about the distribution
of gradients around a pixel
We can visualize H as an ellipse with axis lengths
determined by the eigenvalues of H and orientation
determined by the eigenvectors of H
max, min : eigenvalues of H
Ellipse equation: direction of the
fastest change
u
[u v] H const direction of the
v
slowest change
(max)-1/2
(min)-1/2
Quick eigenvalue/eigenvector
review
The eigenvectors of a matrix A are the vectors x that satisfy:
• The solution:
xmin
xmax
2 “Edge”
2 >> 1 “Corner”
1 and 2 are large,
1 ~ 2 ;
E increases in all
directions
1
Corner detection summary
Here’s what you do
• Compute the gradient at each point in the image
• Create the H matrix from the entries in the gradient
• Compute the eigenvalues.
• Find points with large response (min > threshold)
• Choose those points where min is a local maximum as features
Corner detection summary
Here’s what you do
• Compute the gradient at each point in the image
• Create the H matrix from the entries in the gradient
• Compute the eigenvalues.
• Find points with large response (min > threshold)
• Choose those points where min is a local maximum as features
The Harris operator
min is a variant of the “Harris operator” for feature detection
• The trace is the sum of the diagonals, i.e., trace(H) = h11 + h22
• Very similar to min but less expensive (no square root)
• Called the “Harris Corner Detector” or “Harris Operator”
• Lots of other detectors, this is one of the most popular
The Harris operator
Harris
operator
Harris detector example
f value (red high, blue low)
Threshold (f > value)
Find local maxima of f
Harris features (in red)
Weighting the derivatives
• In practice, using a simple window W doesn’t work
too well
R R
threshold
Corner
K. Grauman, B. Leibe
Automatic Scale Selection
• Function responses for increasing scale (scale signature)
K. Grauman, B. Leibe
Difference-of-Gaussian (DoG)
- =
K. Grauman, B. Leibe
DoG – Efficient Computation
• Computation in Gaussian scale pyramid
Sampling with
step s4 =2
1 s
Original image
2 4
s
K. Grauman, B. Leibe
Find local maxima in position-scale
space of Difference-of-Gaussian
s5
s4
Lxx ( ) L yy ( ) s3
s2
List of
(x, y, s)
s
K. Grauman, B. Leibe
Results: Difference-of-Gaussian
K. Grauman, B. Leibe
Orientation Normalization
[Lowe, SIFT, 1999]
0 2p
T. Tuytelaars, B. Leibe
Maximally Stable Extremal Regions [Matas ‘02]
K. Grauman, B. Leibe
Example Results: MSER
73 K. Grauman, B. Leibe
Available at a web site near you…
• For most local feature detectors, executables are
available online:
– http://www.robots.ox.ac.uk/~vgg/research/affine
– http://www.cs.ubc.ca/~lowe/keypoints/
– http://www.vision.ee.ethz.ch/~surf
K. Grauman, B. Leibe
Two minutes break
Local Descriptors
• The ideal descriptor should be
– Robust
– Distinctive
– Compact
– Efficient
K. Grauman, B. Leibe
Scale Invariant Feature Transform
Basic idea:
• Take 16x16 square window around detected feature
• Compute edge orientation (angle of the gradient - 90) for each pixel
• Throw out weak edges (threshold gradient magnitude)
• Create histogram of surviving edge orientations
0 2
angle histogram
Histogram of oriented
gradients
• Captures important texture
information
• Robust to small translations /
affine deformations
[Lowe, ICCV 1999]
K. Grauman, B. Leibe
Details of Lowe’s SIFT algorithm
• Run DoG detector
– Find maxima in location/scale space
– Remove edge points
• Find all major orientations
– Bin orientations into 36 bin histogram
• Weight by gradient magnitude
• Weight by distance to center (Gaussian-weighted mean)
– Return orientations within 0.8 of peak
• Use parabola for better orientation fit
• For each (x,y,scale,orientation), create descriptor:
– Sample 16x16 gradient mag. and rel. orientation
– Bin 4x4 samples into 4x4 histograms
– Threshold values to max of 0.2, divide by L2 norm
– Final descriptor: 4x4x8 normalized histograms
sift
sift
f1 f2
I1 I2
Feature distance
How to define the difference between two features f1, f2?
• Better approach: ratio distance = ||f1 - f2 || / || f1 - f2’ ||
• f2 is best SSD match to f1 in I2
• f2’ is 2nd best SSD match to f1 in I2
• gives large values for ambiguous matches
f1 f2' f2
I1 I2
Feature matching example
51 matches
Feature matching example
58 matches
Evaluating the results
How can we measure the performance of a feature matcher?
50
75
200
feature distance
True/false positives
How can we measure the performance of a feature matcher?
50
true match
75
200
false match
feature distance
0.7
true
# true positives
positive
# correctly matched features (positives) rate
“recall”
0.7
true
# true positives
positive
# correctly matched features (positives) rate
“recall”
Count = 4
...
Count = 10
Compute edges
at four
orientations
Extract a patch
in each channel
• Why choose?
– Get more points with more detectors