M-File Help: FeatureMatch | View code for FeatureMatch |
Feature correspondence object
This class represents the correspondence between two PointFeature objects. A vector of FeatureMatch objects can represent the correspondence between sets of points.
plot | Plot corresponding points |
show | Show summary statistics of corresponding points |
ransac | Determine inliers and outliers |
inlier | Return inlier matches |
outlier | Return outlier matches |
subset | Return a subset of matches |
display | Display value of match |
char | Convert value of match to string |
p1 | Point coordinates in view 1 (2x1) |
p2 | Point coordinates in view 2 (2x1) |
p | Point coordinates in view 1 and 2 (4x1) |
distance | Match strength between the points |
Properties of a vector of FeatureMatch objects are returned as a vector. If F is a vector (Nx1) of FeatureMatch objects then F.p1 is a 2xN matrix with each column the corresponding view 1 point coordinate.
PointFeature, SurfPointFeature, SiftPointFeature
Create a new FeatureMatch object
m = FeatureMatch(f1, f2, s) is a new FeatureMatch object describing a correspondence between point features f1 and f2 with a strength of s.
m = FeatureMatch(f1, f2) as above but the strength is set to NaN.
PointFeature, SurfPointFeature, SiftPointFeature
Convert to string
s = M.char() is a compact string representation of the match object. If M is a vector then the string has multiple lines, one per element.
Display value
M.display() displays a compact human-readable representation of the feature pair. If M is a vector then the elements are printed one per line.
Inlier features
m2 = M.inlier() is a subset of the FeatureMatch vector M that are considered to be inliers.
FeatureMatch.outlier, FeatureMatch.ransac
Outlier features
m2 = M.outlier() is a subset of the FeatureMatch vector M that are considered to be outliers.
FeatureMatch.inlier, FeatureMatch.ransac
Feature point coordinate pairs
p = M.p() is a 4xN matrix containing the feature point coordinates. Each column contains the coordinates of a pair of corresponding points [u1,v1,u2,v2].
FeatureMatch.p1, FeatureMatch.p2
Feature point coordinates from view 1
p = M.p1() is a 2xN matrix containing the feature points coordinates from view 1. These are the (u,v) properties of the feature F1 passed to the constructor.
FeatureMatch.FeatureMatch, FeatureMatch.p2, FeatureMatch.p
Feature point coordinates from view 2
p = M.p2() is a 2xN matrix containing the feature points coordinates from view 1. These are the (u,v) properties of the feature F2 passed to the constructor.
FeatureMatch.FeatureMatch, FeatureMatch.p1, FeatureMatch.p
Show corresponding points
M.plot() overlays the correspondences in the FeatureMatch vector M on the current figure. The figure must comprise views 1 and 2 side by side, for example by:
idisp({im1,im2}) m.plot()
M.plot(ls) as above but the optional line style arguments ls are passed to plot.
Apply RANSAC
M.ransac(func, options) applies the RANSAC algorithm to fit the point correspondences to the model described by the function func. The options are passed to the RANSAC() function. Elements of the FeatureMatch vector have their status updated in place to indicate whether they are inliers or outliers.
f1 = isurf(im1); f2 = isurf(im2); m = f1.match(f2); m.ransac( @fmatrix, 1e-4);
Display summary statistics of the FeatureMatch vector
M.show() is a compact summary of the FeatureMatch vector M that gives the number of matches, inliers and outliers (and their percentages).
Subset of matches
m2 = M.subset(n) is a FeatureMatch vector with no more than n elements sampled uniformly from M.
© 1990-2012 Peter Corke.