public static < T extends ImageGray < T > , Desc extends TupleDesc > StereoVisualOdometry < T > stereoDualTrackerPnP ( int thresholdAdd , int thresholdRetire , double inlierPixelTol , double epipolarPixelTol , int ransacIterations , int refineIterations , PointTracker < T > trackerLeft , PointTracker < T > trackerRight , DescribeRegionPoint < T , Desc > descriptor , Class < T > imageType ) { EstimateNofPnP pnp = FactoryMultiView . pnp_N ( EnumPNP . P3P_FINSTERWALDER , - 1 ) ; DistanceFromModelMultiView < Se3_F64 , Point2D3D > distanceMono = new PnPDistanceReprojectionSq ( ) ; PnPStereoDistanceReprojectionSq distanceStereo = new PnPStereoDistanceReprojectionSq ( ) ; PnPStereoEstimator pnpStereo = new PnPStereoEstimator ( pnp , distanceMono , 0 ) ; ModelManagerSe3_F64 manager = new ModelManagerSe3_F64 ( ) ; EstimatorToGenerator < Se3_F64 , Stereo2D3D > generator = new EstimatorToGenerator <> ( pnpStereo ) ; // Pixel tolerance for RANSAC inliers - euclidean error squared from left + right images double ransacTOL = 2 * inlierPixelTol * inlierPixelTol ; ModelMatcher < Se3_F64 , Stereo2D3D > motion = new Ransac <> ( 2323 , manager , generator , distanceStereo , ransacIterations , ransacTOL ) ; RefinePnPStereo refinePnP = null ; Class < Desc > descType = descriptor . getDescriptionType ( ) ; ScoreAssociation < Desc > scorer = FactoryAssociation . defaultScore ( descType ) ; AssociateStereo2D < Desc > associateStereo = new AssociateStereo2D <> ( scorer , epipolarPixelTol , descType ) ; // need to make sure associations are unique AssociateDescription2D < Desc > associateUnique = associateStereo ; if ( ! associateStereo . uniqueDestination ( ) || ! associateStereo . uniqueSource ( ) ) { associateUnique = new EnforceUniqueByScore . Describe2D <> ( associateStereo , true , true ) ; } if ( refineIterations > 0 ) { refinePnP = new PnPStereoRefineRodrigues ( 1e-12 , refineIterations ) ; } Triangulate2ViewsMetric triangulate = FactoryMultiView . triangulate2ViewMetric ( new ConfigTriangulation ( ConfigTriangulation . Type . GEOMETRIC ) ) ; VisOdomDualTrackPnP < T , Desc > alg = new VisOdomDualTrackPnP <> ( thresholdAdd , thresholdRetire , epipolarPixelTol , trackerLeft , trackerRight , descriptor , associateUnique , triangulate , motion , refinePnP ) ; return new WrapVisOdomDualTrackPnP <> ( pnpStereo , distanceMono , distanceStereo , associateStereo , alg , refinePnP , imageType ) ; }
Creates a stereo visual odometry algorithm that independently tracks features in left and right camera .