Unit II - Chapter 4 - Feature Detection
Unit II - Chapter 4 - Feature Detection
Unit II
Chapter 4
1
Features
Feature Descriptors
Advantages of local features
Locality
• features are local, so robust to occlusion and clutter
Distinctiveness
• can differentiate a large database of objects
Quantity
• hundreds or thousands in a single image
Efficiency
• real-time performance achievable
Generality
• exploit different types of features in different situations
More motivation…
Feature points are used for:
• Image alignment (e.g., mosaics)
• 3D reconstruction
• Motion tracking
• Object recognition
• Indexing and database retrieval
• Robot navigation
• … other
What makes a good feature?
Want uniqueness
Look for image regions that are unusual
• Lead to unambiguous matches in other images
.
Feature detection
Local measure of feature uniqueness
• How does the window change when you shift it?
• Shifting the window in any direction causes a big change
• The solution:
x-
x+
• The trace is the sum of the diagonals, i.e., trace(H) = h11 + h22
• Very similar to - 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)
Invariance
Suppose you rotate the image by some angle
• Will you still pick up the same features?
Scale?
?
Feature descriptors
We know how to detect good points
Next question: How to match them?
?
Lots of possibilities (this is a popular research area)
• Simple option: match square windows around the point
• State of the art approach: SIFT (Scale Invariant Feature
Transform)
Invariance
Suppose we are comparing two images I1 and I2
• I2 may be a transformed version of I1
• What kinds of transformations are we likely to encounter in
practice?
Invariance
Suppose we are comparing two images I1 and I2
• I2 may be a transformed version of I1
• What kinds of transformations are we likely to encounter in
practice?
8 pixels
0 2
angle histogram
SIFT descriptor
Full version
• Divide the 16x16 window into a 4x4 grid of cells (2x2 case shown below)
• Compute an orientation histogram for each cell
• 16 cells * 8 orientations = 128 dimensional descriptor
Properties of SIFT
Extraordinarily robust matching technique
• Can handle changes in viewpoint
– Up to about 60 degree out of plane rotation
• Can handle significant changes in illumination
– Sometimes even day vs. night (below)
• Fast and efficient—can run in real time
• Lots of code available
– http://people.csail.mit.edu/albert/ladypack/wiki/index.php/Known_implementations_of_SIFT
Maximally Stable Extremal Regions
J.Matas et.al. “Distinguished Regions for Wide-baseline Stereo”. BMVC 2002.
f1 f2
I1 I2
Feature distance
How to define the difference between two features f1, f2?
• Better approach: ratio distance = SSD(f1, f2) / SSD(f1, f2’)
– f2 is best SSD match to f1 in I2
– f2’ is 2nd best SSD match to f1 in I2
– gives small values for ambiguous matches
f1 f2' f2
I1 I2
Evaluating the results
How can we measure the performance of a feature matcher?
50
75
200
feature distance
True/false positives
50
true match
75
200
false match
feature distance
0.7
0.7
SIFT usage:
Recognize
charging
station
Communicate
with visual
cards
Teach object
recognition