0% found this document useful (0 votes)
85 views48 pages

CSE 185 Introduction To Computer Vision: Feature Matching

This document discusses feature matching techniques including keypoint matching, the Hough transform, and RANSAC. It begins by explaining keypoint matching which finds correspondences between keypoints detected in images. It then covers the Hough transform which is used to detect lines and other shapes by having each point vote for parameter values. Finally, it summarizes RANSAC which fits models to data by randomly selecting minimal sample sets and using inliers to refine the model parameters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views48 pages

CSE 185 Introduction To Computer Vision: Feature Matching

This document discusses feature matching techniques including keypoint matching, the Hough transform, and RANSAC. It begins by explaining keypoint matching which finds correspondences between keypoints detected in images. It then covers the Hough transform which is used to detect lines and other shapes by having each point vote for parameter values. Finally, it summarizes RANSAC which fits models to data by randomly selecting minimal sample sets and using inliers to refine the model parameters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 48

CSE 185

Introduction to Computer Vision


Feature Matching
Feature matching
• Keypoint matching
• Hough transform

• Reading: Chapter 4
Feature matching
• Correspondence: matching points, patches,
edges, or regions across images


Keypoint matching 1. Find a set of
distinctive key-
points
A1 B3 2. Define a region
around each
keypoint
A2 A3 3. Extract and
B2 normalize the
B1 region content
4. Compute a local
fA fB descriptor from the
normalized region
5. Match local
descriptors
d ( f A, fB )  T
Review: Interest points

• Keypoint detection: repeatable


and distinctive
– Corners, blobs, stable regions
– Harris, DoG, MSER
– SIFT
Which interest detector
• What do you want it for?
– Precise localization in x-y: Harris
– Good localization in scale: Difference of Gaussian
– Flexible region shape: MSER

• Best choice often application dependent


– Harris-/Hessian-Laplace/DoG work well for many natural categories
– MSER works well for buildings and printed things

• Why choose?
– Get more points with more detectors

• There have been extensive evaluations/comparisons


– [Mikolajczyk et al., IJCV’05, PAMI’05]
– All detectors/descriptors shown here work well
Local feature descriptors
• Most features can be thought of as
templates, histograms (counts), or
combinations
• The ideal descriptor should be
– Robust and distinctive
– Compact and efficient
• Most available descriptors focus
on edge/gradient information
– Capture texture information
– Color rarely used
How to decide which features match?
Feature matching
• Szeliski 4.1.3
– Simple feature-space methods
– Evaluation methods
– Acceleration methods
– Geometric verification (Chapter 6)
Feature matching
• Simple criteria: One feature matches to
another if those features are nearest neighbors
and their distance is below some threshold.
• Problems:
– Threshold is difficult to set
– Non-distinctive features could have lots of close
matches, only one of which is correct
Matching local features
• Threshold based on the ratio of 1st nearest neighbor to
2nd nearest neighbor distance

Reject all matches in which


the distance ration > 0.8, which
eliminates 90% of false matches
while discarding less than 5%
correct matches
SIFT repeatability

It shows the stability of detection for keypoint location, orientation, and final matching to a
database as a function of affine distortion. The degree of affine distortion is expressed
in terms of the equivalent viewpoint rotation in depth for a planar surface.
Matching features

What do we do about the “bad” matches?


RAndom SAmple Consensus

Select one match, count inliers


RAndom SAmple Consensus

Select one match, count inliers


Least squares fit

Find “average” translation vector


RANSAC
• Random Sample Consensus • Issues
• Choose a small subset uniformly – How many times?
at random • Often enough that we are
• Fit to that likely to have a good line
– How big a subset?
• Anything that is close to result is
• Smallest possible
signal; all others are noise
– What does close mean?
• Refit
• Depends on the problem
• Do this many times and choose
– What is a good line?
the best
• One where the number of
nearby points is so big it is
unlikely to be all outliers
Descriptor Vector
• Orientation = blurred gradient
• Similarity Invariant Frame
– Scale-space position (x, y, s) + orientation ()

Image Stitching 19
RANSAC for Homography
RANSAC for Homography
RANSAC for Homography
RANSAC for Homography
Probabilistic model for verification
Finding the panoramas
Finding the panoramas

Finding connected
components
Finding the panoramas
Results
Fitting and alignment
Fitting: find the parameters of a model that
best fit the data

Alignment: find the parameters of the


transformation that best align matched points
Checkerboard
• Often used in camera calibration
Fitting and alignment
• Design challenges
– Design a suitable goodness of fit measure
• Similarity should reflect application goals
• Encode robustness to outliers and noise
– Design an optimization method
• Avoid local optima
• Find best parameters quickly
Fitting and alignment: Methods

• Global optimization / Search for parameters


– Least squares fit
– Robust least squares
– Iterative closest point (ICP)

• Hypothesize and test


– Generalized Hough transform
– RANSAC
Least squares line fitting
• Data: (x1, y1), …, (xn, yn) y=mx+b
• Line equation: yi = m xi + b
• Find (m, b) to minimize (xi, yi)
E  i 1 ( yi  m xi  b) 2
n

dE
 2 A T Ap  2 A T y  0
dp Matlab: p = A \ y;

y  p   A A
1
A Ap  A
T T T
AT y
Least squares (global) optimization
Good
• Clearly specified objective
• Optimization is easy

Bad
• May not be what you want to optimize
• Sensitive to outliers
– Bad matches, extra points
• Doesn’t allow you to get multiple good fits
– Detecting multiple objects, lines, etc.
Hypothesize and test
1. Propose parameters
– Try all possible
– Each point votes for all consistent parameters
– Repeatedly sample enough points to solve for parameters

2. Score the given parameters


– Number of consistent points, possibly weighted by distance

3. Choose from among the set of parameters


– Global or local maximum of scores

4. Possibly refine parameters using inliers


Hough transform: Outline

1. Create a grid of parameter values

2. Each point votes for a set of parameters,


incrementing those values in grid

3. Find maximum or local maxima in grid


Hough transform
Given a set of points, find the curve or line that explains the
data points best
Duality: Each
point has a dual
line in the
y m parameter space

x b
Hough space
y=mx+b m = -(1/x)b + y/x
Hough transform
y m

x b

y m
3 5 3 3 2 2
3 7 11 10 4 3
2 3 1 4 5 2
2 1 0 1 3 3

x b
Hough transform
Issue : parameter space [m,b] is unbounded…
Use a polar representation for the parameter space

Duality: Each
y point has a dual
curve in the
parameter space

x
Hough space
cos  r r  x0 cos   y0 sin 
y  ( )x  ( )
sin  sin 
Hough transform: Experiments

features votes
Hough transform
Hough transform: Experiments
Noisy data

features votes

Need to adjust grid size or smooth


Hough transform: Experiments

features votes

Issue: spurious peaks due to uniform noise


1. Image  Canny
2. Canny  Hough votes
3. Hough votes  Edges

Find peaks and post-process


Hough transform example
Hough transform: Finding lines
• Using m,b parameterization
• Using r, theta parameterization
– Using oriented gradients
• Practical considerations
– Bin size
– Smoothing
– Finding multiple lines
– Finding line segments

You might also like