/** * Construct using the {@link RANSAC} algorithm with the given options. * * @param threshold * the threshold on the {@link AlgebraicResidual2d} at which to * consider a point as an inlier * @param nIterations * the maximum number of iterations * @param stoppingCondition * the {@link StoppingCondition} for RANSAC */ public RobustAffineTransformEstimator(double threshold, int nIterations, StoppingCondition stoppingCondition) { robustFitter = new RANSAC<Point2d, Point2d, AffineTransformModel>(new AffineTransformModel(), new AlgebraicResidual2d<AffineTransformModel>(), threshold, nIterations, stoppingCondition, true, new BucketingSampler2d()); }
/** * Construct using the {@link RANSAC} algorithm with the given options. * * @param threshold * the threshold on the {@link AlgebraicResidual2d} at which to * consider a point as an inlier * @param nIterations * the maximum number of iterations * @param stoppingCondition * the {@link StoppingCondition} for RANSAC * @param modelCheck * the predicate to test whether an estimated model is sane */ public RobustAffineTransformEstimator(double threshold, int nIterations, StoppingCondition stoppingCondition, Predicate<AffineTransformModel> modelCheck) { robustFitter = new RANSAC<Point2d, Point2d, AffineTransformModel>(new AffineTransformModel(modelCheck), new AlgebraicResidual2d<AffineTransformModel>(), threshold, nIterations, stoppingCondition, true, new BucketingSampler2d()); }
/** * Construct using the {@link RANSAC} algorithm with the given options. * * @param threshold * the threshold on the {@link AlgebraicResidual2d} at which to * consider a point as an inlier * @param nIterations * the maximum number of iterations * @param stoppingCondition * the {@link StoppingCondition} for RANSAC * @param refinement * the refinement technique */ public RobustFundamentalEstimator(double threshold, int nIterations, StoppingCondition stoppingCondition, FundamentalRefinement refinement) { robustFitter = new RANSAC<Point2d, Point2d, FundamentalModel>(new FundamentalModel(false), new FundamentalModel.Fundamental8PtResidual(), threshold, nIterations, stoppingCondition, true, new BucketingSampler2d()); this.refinement = refinement; }
/** * Construct using the {@link RANSAC} algorithm with the given options. * * @param threshold * the threshold on the {@link AlgebraicResidual2d} at which to * consider a point as an inlier * @param nIterations * the maximum number of iterations * @param stoppingCondition * the {@link StoppingCondition} for RANSAC * @param refinement * the refinement technique */ public RobustHomographyEstimator(double threshold, int nIterations, StoppingCondition stoppingCondition, HomographyRefinement refinement) { robustFitter = new RANSAC<Point2d, Point2d, HomographyModel>(new HomographyModel(false), new SymmetricTransferResidual2d<HomographyModel>(), threshold, nIterations, stoppingCondition, true, new BucketingSampler2d()); this.refinement = refinement; }
/** * Construct using the {@link RANSAC} algorithm with the given options. * * @param threshold * the threshold on the {@link AlgebraicResidual2d} at which to * consider a point as an inlier * @param nIterations * the maximum number of iterations * @param stoppingCondition * the {@link StoppingCondition} for RANSAC * @param refinement * the refinement technique * @param modelCheck * the predicate to test whether an estimated model is sane */ public RobustHomographyEstimator(double threshold, int nIterations, StoppingCondition stoppingCondition, HomographyRefinement refinement, Predicate<HomographyModel> modelCheck) { robustFitter = new RANSAC<Point2d, Point2d, HomographyModel>(new HomographyModel(false, modelCheck), new SymmetricTransferResidual2d<HomographyModel>(), threshold, nIterations, stoppingCondition, true, new BucketingSampler2d()); this.refinement = refinement; }
final RANSAC<Point2d, Point2d, HomographyModel> ransac = new RANSAC<Point2d, Point2d, HomographyModel>( model, new SingleImageTransferResidual2d<HomographyModel>(), 3.0, 1500, new RANSAC.ProbabilisticMinInliersStoppingCondition(0.01), true);
final RANSAC<Point2d, Point2d, HomographyModel> ransac = new RANSAC<Point2d, Point2d, HomographyModel>( model, new SingleImageTransferResidual2d<HomographyModel>(), 3.0, 1500, new RANSAC.ProbabilisticMinInliersStoppingCondition(0.01), true);
normalmatcher = new ConsistentLocalFeatureMatcher2d<Keypoint>( new FastBasicKeypointMatcher<Keypoint>(8), new RANSAC<Point2d, Point2d, AffineTransformModel>(new AffineTransformModel(), new SingleImageTransferResidual2d<AffineTransformModel>(), 5.0, 100, new RANSAC.ProbabilisticMinInliersStoppingCondition(0.01), true) altmatcher = new ConsistentLocalFeatureMatcher2d<Keypoint>( new FastBasicKeypointMatcher<Keypoint>(8), new RANSAC<Point2d, Point2d, AffineTransformModel>(new AffineTransformModel(), new SingleImageTransferResidual2d<AffineTransformModel>(), 5.0, 100, new RANSAC.ProbabilisticMinInliersStoppingCondition(0.01), true)
private Matrix estimateModel() { if (this.initialFeatures == null) { return null; } final List<? extends IndependentPair<Point2d, Point2d>> pairs = findAllMatchedPairs(); final HomographyModel model = new HomographyModel(); // model.estimate(pairs); final RANSAC<Point2d, Point2d, HomographyModel> fitter = new RANSAC<Point2d, Point2d, HomographyModel>(model, new SingleImageTransferResidual2d<HomographyModel>(), 10.0, 1500, new RANSAC.PercentageInliersStoppingCondition(0.5), false); if (!fitter.fitData(pairs)) return null; model.getTransform().print(5, 5); return model.getTransform(); }
private Matrix estimateModel() { if (this.initialFeatures == null) { return null; } final List<? extends IndependentPair<Point2d, Point2d>> pairs = findAllMatchedPairs(); final HomographyModel model = new HomographyModel(); // model.estimate(pairs); final RANSAC<Point2d, Point2d, HomographyModel> fitter = new RANSAC<Point2d, Point2d, HomographyModel>(model, new SingleImageTransferResidual2d<HomographyModel>(), 10.0, 1500, new RANSAC.PercentageInliersStoppingCondition(0.5), false); if (!fitter.fitData(pairs)) return null; model.getTransform().print(5, 5); return model.getTransform(); }
new FastBasicKeypointMatcher<Keypoint>(8)); final HomographyModel model = new HomographyModel(); final RANSAC<Point2d, Point2d, HomographyModel> modelFitting = new RANSAC<Point2d, Point2d, HomographyModel>( model, new SingleImageTransferResidual2d<HomographyModel>(), 8.0, 1600, new RANSAC.BestFitStoppingCondition(),
new FastBasicKeypointMatcher<Keypoint>(8)); final HomographyModel model = new HomographyModel(); final RANSAC<Point2d, Point2d, HomographyModel> modelFitting = new RANSAC<Point2d, Point2d, HomographyModel>( model, new SingleImageTransferResidual2d<HomographyModel>(), 8.0, 1600, new RANSAC.BestFitStoppingCondition(),
final HomographyModel model = new HomographyModel(); final RANSAC<Point2d, Point2d, HomographyModel> modelFitting = new RANSAC<Point2d, Point2d, HomographyModel>(model, new SingleImageTransferResidual2d<HomographyModel>(), 8.0, 1600, new RANSAC.BestFitStoppingCondition(), true);
final RANSAC<Point2d, Point2d, HomographyModel> ransac = new RANSAC<Point2d, Point2d, HomographyModel>(model, errorModel, 5f, 1500, new RANSAC.BestFitStoppingCondition(), true); final ConsistentLocalFeatureMatcher2d<Keypoint> matcher = new ConsistentLocalFeatureMatcher2d<Keypoint>(
final RANSAC<Point2d, Point2d, HomographyModel> ransac = new RANSAC<Point2d, Point2d, HomographyModel>(model, errorModel, 5f, 1500, new RANSAC.BestFitStoppingCondition(), true); final ConsistentLocalFeatureMatcher2d<Keypoint> matcher = new ConsistentLocalFeatureMatcher2d<Keypoint>(
final RANSAC<Point2d, Point2d, HomographyModel> ransac = new RANSAC<Point2d, Point2d, HomographyModel>(model, new SingleImageTransferResidual2d<HomographyModel>(), 12.0, 600, new RANSAC.BestFitStoppingCondition(), true);
final RANSAC<Point2d, Point2d, HomographyModel> ransac = new RANSAC<Point2d, Point2d, HomographyModel>(model, new SingleImageTransferResidual2d<HomographyModel>(), 12.0, 600, new RANSAC.BestFitStoppingCondition(), true);