public class RobustFundamentalEstimator extends Object implements RobustModelFitting<Point2d,Point2d,FundamentalModel>
An initial estimate of the inliers and an algebraically optimal Fundamental
matrix is computed using RANSAC
or LMedS
with a
BucketingSampler2d
sampling strategy for selecting subsets. In both
cases, the normalised 8-point algorithm is used (see
TransformUtilities.fundamentalMatrix8PtNorm(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
FundamentalRefinement
.
Constructor and Description |
---|
RobustFundamentalEstimator(double outlierProportion,
FundamentalRefinement refinement)
Construct using the
LMedS algorithm with the given expected
outlier percentage |
RobustFundamentalEstimator(double threshold,
int nIterations,
RANSAC.StoppingCondition stoppingCondition,
FundamentalRefinement refinement)
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() |
FundamentalModel |
getModel() |
List<? extends IndependentPair<Point2d,Point2d>> |
getOutliers() |
int |
numItemsToEstimate() |
public RobustFundamentalEstimator(double outlierProportion, FundamentalRefinement refinement)
LMedS
algorithm with the given expected
outlier percentageoutlierProportion
- expected proportion of outliers (between 0 and 1)refinement
- the refinement techniquepublic RobustFundamentalEstimator(double threshold, int nIterations, RANSAC.StoppingCondition stoppingCondition, FundamentalRefinement 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 boolean fitData(List<? extends IndependentPair<Point2d,Point2d>> data)
ModelFitting
fitData
in interface ModelFitting<Point2d,Point2d,FundamentalModel>
data
- Data to be fittedpublic int numItemsToEstimate()
numItemsToEstimate
in interface ModelFitting<Point2d,Point2d,FundamentalModel>
public FundamentalModel getModel()
getModel
in interface ModelFitting<Point2d,Point2d,FundamentalModel>
public List<? extends IndependentPair<Point2d,Point2d>> getInliers()
getInliers
in interface RobustModelFitting<Point2d,Point2d,FundamentalModel>
public List<? extends IndependentPair<Point2d,Point2d>> getOutliers()
getOutliers
in interface RobustModelFitting<Point2d,Point2d,FundamentalModel>