3local_features
3local_features
Image Processing
Pinar Duygulu
Two images from NASA Mars Rover: matching using local features
Image matching applications
Recognition
Texture recognition
Car detection
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
Local features
• What makes a good feature?
• We want uniqueness.
• Look for image regions that are unusual.
• Lead to unambiguous matches in other images.
• How to define “unusual”?
0D structure
not useful for matching
1D structure
edge, can be localized in 1D,
subject to the aperture problem
2D structure
corner, can be localized in 2D,
good for matching
Local measures of uniqueness
• We should easily recognize the local feature by looking through a
small window.
• Shifting the window in any direction should give a large change in
intensity.
()
local descriptor
W
Local features: detection
• Consider shifting the window W by (u,v):
• How do the pixels in W change?
• Auto-correlation function measures
the self similarity of a signal and is W
related to the sum-of-squared
difference.
• Compare each pixel before and
after the shift by summing up the
squared differences (SSD).
• This defines an SSD “error” of E(u,v):
Local features: detection
• Taylor Series expansion of I:
http://fedc.wiwi.hu-berlin.de/xplore/tutorials/mvahtmlnode16.html
Quick eigenvector/eigenvalue review
• The eigenvectors of a matrix A are the vectors x that satisfy:
• The solution:
x-
[sum over all (x,y)]
x+
• Eigenvalues and eigenvectors of H:
• Define shifts with the smallest and largest change (E value).
• x+ = direction of largest increase in E.
• + = amount of increase in direction x+.
• x- = direction of smallest increase in E.
• - = amount of increase in direction x-.
Local features: detection
• How are +, x+, -, and x- relevant for feature detection?
• What’s our feature scoring function?
• Want E(u,v) to be large for small shifts in all directions.
• The minimum of E(u,v) should be large, over all unit vectors [u v].
• This minimum is given by the smaller eigenvalue (-) of H.
Local features: detection
• 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 (- > threshold).
• Choose those points where - is a local maximum as features.
Local features: detection
• 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 (- > threshold).
• Choose those points where - is a local maximum as features.
Harris detector
• To measure the corner strength:
R = det(H) – k(trace(H))2
where
trace(H) = 1 + 2
det(H) = 1 x 2
(1 and 2 are the eigenvalues of H).
• R is positive for corners, negative in edge regions, and small in
flat regions.
• Very similar to - but less expensive (no square root).
• Also called the “Harris Corner Detector” or “Harris Operator”.
• Lots of other detectors, this is one of the most popular.
Harris detector example
Harris detector example
Local maxima of R
Harris detector example
()
local descriptor
?
() = ()
• Vector comparison using a distance measure can be used.
Local features: matching
• Given a feature in I1, how to find the best match in I2?
1. Define a distance function that compares two descriptors.
2. Test all the features in I2, find the one with minimum distance.
50
75
200
feature
distance
Matching examples
Matching examples
Local features: matching
• Matches can be improved using local constraints
• neighboring points should match
• angles, length ratios should be similar
1
1
1 ~1
2 ~2
2
2
3
Summary of the approach
For each octave of scale space, the initial image is repeatedly convolved with Gaussian to produce
the set of scale space images (left). Adjacent Gaussian images are subtracted to produce
difference of Gaussian images (right). After each octave Gaussian image is downsampled by a
factor of 2.
Interest point localization
• Detect maxima and minima of
difference of Gaussian in scale space.
0 2
Interest point descriptors
• At this point, each interest point has
• location,
• scale,
• orientation.
• Next step is to compute a descriptor for the local image region about
each interest point that is
• highly distinctive,
• invariant as possible to variations such as changes in viewpoint and
illumination.
Lowe’s interest point descriptor
• Use the normalized circular region about the interest point.
• Rotate the window to standard orientation.
• Scale the window size based on the scale at which the point was found.
• Compute gradient magnitude and orientation at each point in the region.
• Weight them by a Gaussian window overlaid on the circle.
• Create an orientation histogram over the 4x4 subregions of the window.
• 4x4 descriptors over 16x16 sample array were used in practice. 4x4 times 8
directions gives a vector of 128 values.
Lowe’s interest point descriptor
An info pane on the left shows information about the current image and navigation buttons
for moving around the collection; the filmstrip view on the bottom shows related images;
mousing over these images brings them up as a registered overlay.
Photo tourism: exploring photo collections
• http://grail.cs.washington.edu/projects/canonview