boofcv.alg.fiducial.square
Class QuadPoseEstimator
- java.lang.Object
-
- boofcv.alg.fiducial.square.QuadPoseEstimator
-
public class QuadPoseEstimator extends java.lang.ObjectEstimates the pose using P3P and iterative refinement from 4 points on a plane with known locations. While this seems like it would be a trivial problem it actually takes several techniques to ensure accurate results. At a high level it uses P3P to provide an estimate. If the error is large it then uses EPNP. Which ever is better it then refines. If the target is small and directly facing the camera it will enlarge the target to estimate it's orientation. Otherwise it will over fit location since it takes a large change in orientation to influence the result.
-
-
Field Summary
Fields Modifier and Type Field and Description static doubleFUDGE_FACTORstatic doubleSMALL_PIXELS
-
Constructor Summary
Constructors Constructor and Description QuadPoseEstimator(double refineTol, int refineIterations)Constructor which picks reasonable and generally good algorithms for pose estimation.QuadPoseEstimator(EstimateNofPnP p3p, RefinePnP refine)Constructor in which internal estimation algorithms are provided
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetError()Reprojection error of fiducialSe3_F64getWorldToCamera()booleanprocess(Quadrilateral_F64 corners)Estimate the 3D pose of the camera from the observed location of the fiducial.voidsetFiducial(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3)Specify the location of points on the 2D fiducial.voidsetIntrinsic(IntrinsicParameters intrinsic)Specifies the intrinsic parameters.
-
-
-
Field Detail
-
SMALL_PIXELS
public static final double SMALL_PIXELS
- See Also:
- Constant Field Values
-
FUDGE_FACTOR
public static final double FUDGE_FACTOR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
QuadPoseEstimator
public QuadPoseEstimator(double refineTol, int refineIterations)Constructor which picks reasonable and generally good algorithms for pose estimation.- Parameters:
refineTol- Convergence tolerance. Try 1e-8refineIterations- Number of refinement iterations. Try 200
-
QuadPoseEstimator
public QuadPoseEstimator(EstimateNofPnP p3p, RefinePnP refine)
Constructor in which internal estimation algorithms are provided
-
-
Method Detail
-
setIntrinsic
public void setIntrinsic(IntrinsicParameters intrinsic)
Specifies the intrinsic parameters.- Parameters:
intrinsic- Intrinsic camera parameters
-
setFiducial
public void setFiducial(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3)Specify the location of points on the 2D fiducial.
-
process
public boolean process(Quadrilateral_F64 corners)
Estimate the 3D pose of the camera from the observed location of the fiducial.
MUST callsetFiducial(double, double, double, double, double, double, double, double)andsetIntrinsic(boofcv.struct.calib.IntrinsicParameters)before calling this function.- Parameters:
corners- Observed corners of fiducials which are in the same order as their 2D counter parts- Returns:
- true if successful or false if not
-
getWorldToCamera
public Se3_F64 getWorldToCamera()
-
getError
public double getError()
Reprojection error of fiducial
-
-
DataMelt 3.0 © DataMelt by jWork.ORG