Professional Documents
Culture Documents
AI Program
College of Computer Science and Engineering
University of Jeddah
?
Feature matching
• Exhaustive search
• for each feature in one image, look at all the other features
in the other image(s)
• Hashing
• compute a short descriptor from each feature vector, or hash
longer descriptors (randomly)
• Nearest neighbor techniques
• k-trees and their variants
What about outliers?
?
Feature-space outlier rejection
Let’s not match all features, but only these that have
“similar enough” matches?
How can we do it?
• SSD(patch1,patch2) < threshold
• How to set threshold?
Feature-space outlier rejection
A better way [Lowe, 1999]:
• 1-NN: Sum of Squared Difference (SSD) of the closest
match
• 2-NN: SSD of the second-closest match
• Look at how much better 1-NN is than 2-NN, e.g. 1-NN/2-NN
• That is, is our best match so much better than the rest?
Feature-space outliner rejection
10
Illustration of RANSAC
11
Illustration of RANSAC
12
Illustration of RANSAC
• Calculate model
parameters that fit the
data in the sample
13
Illustration of RANSAC
• Calculate model
parameters that fit the
data in the sample
14
Illustration of RANSAC
• Calculate model
parameters that fit the
data in the sample
15
Illustration of RANSAC
• Calculate model
parameters that fit the
data in the sample
• Repeat sampling
16
Illustration of RANSAC
• Calculate model
parameters that fit the
data in the sample
• Repeat sampling
17
Illustration of RANSAC
ALL-INLIER SAMPLE
RANSAC time complexity
k … number of samples
drawn
N … number of data points
tM … time to compute a single
model
mS … average number of
18
models per sample
RANSAC Algorithm
Input:
• data: a set of observations
• model: a model that can be fitted to data
• n: the minimum number of data required to fit the model
• k: the maximum number of iterations allowed in the algorithm
• t: a threshold value for determining when a datum fits a model
• d: the number of close data values required to assert that a model
fits well to data
Output:
• best_model : model parameters which best fit the data (or nil if no
good model is found)
• best_consensus_set : data point from which this model has been
estimated
• best_error : the error of this model relative to the data
19
RANSAC Algorithm
20
Parameters
1 p 1 w k: Iteration times.
n k
n: Selected points in one iteration.
p: Probability in k iteration
log1 p selects
k only inliers.
log(1 w )
n
w: Probability of a point which is
a inlier.
RANSAC loop:
1. Select four feature pairs (at random)
2. Compute homography H (exact)
3. Compute inliers where SSD(pi’, H pi) < ε
4. Keep largest set of inliers
5. Re-compute least-squares H estimate on all of the
inliers
RANSAC
Why “Recognising Panoramas”?
1D Rotations (q)
• Ordering matching images
• 2D Rotations (q, f)
– Ordering matching images
Why “Recognising Panoramas”?
RANSAC for Homography
RANSAC for Homography
Application: Image stitching
Probabilistic model for verification
Finding the panoramas
Finding the panoramas
Finding the panoramas
Finding the panoramas