public class RobustHomographyEstimator extends Object implements RobustModelFitting<Point2d,Point2d,HomographyModel>
An initial estimate of the inliers and an algebraically optimal homography is
computed using RANSAC or LMedS with a
BucketingSampler2d sampling strategy for selecting subsets. In both
cases, the normalised DLT algorithm is used (see
TransformUtilities.homographyMatrixNorm(List)
If an reasonable initial estimate was found, non-linear optimisation using
Levenburg-Marquardt is performed to on the inliers using the initial estimate
to optimise against a true geometric residual given by
HomographyRefinement.
| Constructor and Description |
|---|
RobustHomographyEstimator(double outlierProportion,
HomographyRefinement refinement)
Construct using the
LMedS algorithm with the given expected
outlier percentage |
RobustHomographyEstimator(double outlierProportion,
HomographyRefinement refinement,
Predicate<HomographyModel> modelCheck)
Construct using the
LMedS algorithm with the given expected
outlier percentage |
RobustHomographyEstimator(double threshold,
int nIterations,
RANSAC.StoppingCondition stoppingCondition,
HomographyRefinement refinement)
Construct using the
RANSAC algorithm with the given options. |
RobustHomographyEstimator(double threshold,
int nIterations,
RANSAC.StoppingCondition stoppingCondition,
HomographyRefinement refinement,
Predicate<HomographyModel> modelCheck)
Construct using the
RANSAC algorithm with the given options. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
fitData(List<? extends IndependentPair<Point2d,Point2d>> data)
Attempt to fit the given data to the model.
|
List<? extends IndependentPair<Point2d,Point2d>> |
getInliers() |
HomographyModel |
getModel() |
List<? extends IndependentPair<Point2d,Point2d>> |
getOutliers() |
int |
numItemsToEstimate() |
public RobustHomographyEstimator(double outlierProportion, HomographyRefinement refinement)
LMedS algorithm with the given expected
outlier percentageoutlierProportion - expected proportion of outliers (between 0 and 1)refinement - the refinement techniquepublic RobustHomographyEstimator(double threshold, int nIterations, RANSAC.StoppingCondition stoppingCondition, HomographyRefinement refinement)
RANSAC algorithm with the given options.threshold - the threshold on the AlgebraicResidual2d at which to
consider a point as an inliernIterations - the maximum number of iterationsstoppingCondition - the RANSAC.StoppingCondition for RANSACrefinement - the refinement techniquepublic RobustHomographyEstimator(double outlierProportion, HomographyRefinement refinement, Predicate<HomographyModel> modelCheck)
LMedS algorithm with the given expected
outlier percentageoutlierProportion - expected proportion of outliers (between 0 and 1)refinement - the refinement techniquemodelCheck - the predicate to test whether an estimated model is sanepublic RobustHomographyEstimator(double threshold, int nIterations, RANSAC.StoppingCondition stoppingCondition, HomographyRefinement refinement, Predicate<HomographyModel> modelCheck)
RANSAC algorithm with the given options.threshold - the threshold on the AlgebraicResidual2d at which to
consider a point as an inliernIterations - the maximum number of iterationsstoppingCondition - the RANSAC.StoppingCondition for RANSACrefinement - the refinement techniquemodelCheck - the predicate to test whether an estimated model is sanepublic boolean fitData(List<? extends IndependentPair<Point2d,Point2d>> data)
ModelFittingfitData in interface ModelFitting<Point2d,Point2d,HomographyModel>data - Data to be fittedpublic int numItemsToEstimate()
numItemsToEstimate in interface ModelFitting<Point2d,Point2d,HomographyModel>public HomographyModel getModel()
getModel in interface ModelFitting<Point2d,Point2d,HomographyModel>public List<? extends IndependentPair<Point2d,Point2d>> getInliers()
getInliers in interface RobustModelFitting<Point2d,Point2d,HomographyModel>public List<? extends IndependentPair<Point2d,Point2d>> getOutliers()
getOutliers in interface RobustModelFitting<Point2d,Point2d,HomographyModel>