Search in sources :

Example 6 with PlanePtPixel

use of boofcv.struct.sfm.PlanePtPixel in project BoofCV by lessthanoptimal.

the class FactoryVisualOdometry method monoPlaneInfinity.

/**
 * Monocular plane based visual odometry algorithm which uses both points on the plane and off plane for motion
 * estimation.
 *
 * @see VisOdomMonoPlaneInfinity
 *
 * @param thresholdAdd  New points are spawned when the number of on plane inliers drops below this value.
 * @param thresholdRetire Tracks are dropped when they are not contained in the inlier set for this many frames
 *                        in a row.  Try 2
 * @param inlierPixelTol Threshold used to determine inliers in pixels.  Try 1.5
 * @param ransacIterations Number of RANSAC iterations.  Try 200
 * @param tracker Image feature tracker
 * @param imageType Type of input image it processes
 * @param <T>
 * @return New instance of
 */
public static <T extends ImageGray<T>> MonocularPlaneVisualOdometry<T> monoPlaneInfinity(int thresholdAdd, int thresholdRetire, double inlierPixelTol, int ransacIterations, PointTracker<T> tracker, ImageType<T> imageType) {
    // squared pixel error
    double ransacTOL = inlierPixelTol * inlierPixelTol;
    ModelManagerSe2_F64 manager = new ModelManagerSe2_F64();
    DistancePlane2DToPixelSq distance = new DistancePlane2DToPixelSq();
    GenerateSe2_PlanePtPixel generator = new GenerateSe2_PlanePtPixel();
    ModelMatcher<Se2_F64, PlanePtPixel> motion = new Ransac<>(2323, manager, generator, distance, ransacIterations, ransacTOL);
    VisOdomMonoPlaneInfinity<T> alg = new VisOdomMonoPlaneInfinity<>(thresholdAdd, thresholdRetire, inlierPixelTol, motion, tracker);
    return new MonoPlaneInfinity_to_MonocularPlaneVisualOdometry<>(alg, distance, generator, imageType);
}
Also used : GenerateSe2_PlanePtPixel(boofcv.alg.sfm.robust.GenerateSe2_PlanePtPixel) GenerateSe2_PlanePtPixel(boofcv.alg.sfm.robust.GenerateSe2_PlanePtPixel) PlanePtPixel(boofcv.struct.sfm.PlanePtPixel) DistancePlane2DToPixelSq(boofcv.alg.sfm.robust.DistancePlane2DToPixelSq) ModelManagerSe2_F64(georegression.fitting.se.ModelManagerSe2_F64) Se2_F64(georegression.struct.se.Se2_F64) Ransac(org.ddogleg.fitting.modelset.ransac.Ransac) ModelManagerSe2_F64(georegression.fitting.se.ModelManagerSe2_F64)

Aggregations

PlanePtPixel (boofcv.struct.sfm.PlanePtPixel)6 Test (org.junit.Test)3 Point2D_F64 (georegression.struct.point.Point2D_F64)2 Se2_F64 (georegression.struct.se.Se2_F64)2 PointTrack (boofcv.abst.feature.tracker.PointTrack)1 CameraPlaneProjection (boofcv.alg.sfm.overhead.CameraPlaneProjection)1 DistancePlane2DToPixelSq (boofcv.alg.sfm.robust.DistancePlane2DToPixelSq)1 GenerateSe2_PlanePtPixel (boofcv.alg.sfm.robust.GenerateSe2_PlanePtPixel)1 MotionTransformPoint (georegression.fitting.MotionTransformPoint)1 ModelManagerSe2_F64 (georegression.fitting.se.ModelManagerSe2_F64)1 Ransac (org.ddogleg.fitting.modelset.ransac.Ransac)1