Search in sources :

Example 1 with ConfigEssential

use of boofcv.factory.geo.ConfigEssential in project BoofCV by lessthanoptimal.

the class ExampleStereoTwoViewsOneCamera method estimateCameraMotion.

/**
 * Estimates the camera motion robustly using RANSAC and a set of associated points.
 *
 * @param intrinsic   Intrinsic camera parameters
 * @param matchedNorm set of matched point features in normalized image coordinates
 * @param inliers     OUTPUT: Set of inlier features from RANSAC
 * @return Found camera motion.  Note translation has an arbitrary scale
 */
public static Se3_F64 estimateCameraMotion(CameraPinholeRadial intrinsic, List<AssociatedPair> matchedNorm, List<AssociatedPair> inliers) {
    ModelMatcher<Se3_F64, AssociatedPair> epipolarMotion = FactoryMultiViewRobust.essentialRansac(new ConfigEssential(intrinsic), new ConfigRansac(200, 0.5));
    if (!epipolarMotion.process(matchedNorm))
        throw new RuntimeException("Motion estimation failed");
    // save inlier set for debugging purposes
    inliers.addAll(epipolarMotion.getMatchSet());
    return epipolarMotion.getModelParameters();
}
Also used : AssociatedPair(boofcv.struct.geo.AssociatedPair) ConfigEssential(boofcv.factory.geo.ConfigEssential) ConfigRansac(boofcv.factory.geo.ConfigRansac) Se3_F64(georegression.struct.se.Se3_F64)

Aggregations

ConfigEssential (boofcv.factory.geo.ConfigEssential)1 ConfigRansac (boofcv.factory.geo.ConfigRansac)1 AssociatedPair (boofcv.struct.geo.AssociatedPair)1 Se3_F64 (georegression.struct.se.Se3_F64)1