44 #ifndef RTABMAP_CORELIB_SRC_OPENCV_SOLVEPNP_H_ 45 #define RTABMAP_CORELIB_SRC_OPENCV_SOLVEPNP_H_ 47 #include <opencv2/core/core.hpp> 48 #include <opencv2/calib3d/calib3d.hpp> 49 #if CV_MAJOR_VERSION >= 3 50 #include <opencv2/calib3d/calib3d_c.h> 93 bool solvePnPRansac( cv::InputArray objectPoints, cv::InputArray imagePoints,
94 cv::InputArray cameraMatrix, cv::InputArray distCoeffs,
95 cv::OutputArray rvec, cv::OutputArray tvec,
96 bool useExtrinsicGuess =
false,
int iterationsCount = 100,
97 float reprojectionError = 8.0,
double confidence = 0.99,
98 cv::OutputArray inliers = cv::noArray(),
int flags = CV_ITERATIVE );
109 virtual bool compute(cv::InputArray param, cv::OutputArray err, cv::OutputArray J)
const = 0;
112 virtual void setCallback(
const cv::Ptr<LMSolver::Callback>& cb) = 0;
113 virtual int run(cv::InputOutputArray _param0)
const = 0;
116 cv::Ptr<LMSolver>
createLMSolver(
const cv::Ptr<LMSolver::Callback>& cb,
int maxIters);
125 virtual int runKernel(cv::InputArray m1, cv::InputArray m2, cv::OutputArray
model)
const = 0;
126 virtual void computeError(cv::InputArray m1, cv::InputArray m2, cv::InputArray model, cv::OutputArray err)
const = 0;
127 virtual bool checkSubset(cv::InputArray, cv::InputArray,
int)
const {
return true; }
130 virtual void setCallback(
const cv::Ptr<PointSetRegistrator::Callback>& cb) = 0;
131 virtual bool run(cv::InputArray m1, cv::InputArray m2, cv::OutputArray
model, cv::OutputArray
mask)
const = 0;
135 int modelPoints,
double threshold,
136 double confidence=0.99,
int maxIters=1000 );
139 int modelPoints,
double confidence=0.99,
int maxIters=1000 );
144 for( i = j = 0; i < count; i++ )
GLM_FUNC_DECL genIType mask(genIType const &count)
int RANSACUpdateNumIters(double p, double ep, int modelPoints, int maxIters)
Ptr< PointSetRegistrator > createRANSACPointSetRegistrator(const Ptr< PointSetRegistrator::Callback > &_cb, int _modelPoints, double _threshold, double _confidence, int _maxIters)
bool solvePnPRansac(InputArray _opoints, InputArray _ipoints, InputArray _cameraMatrix, InputArray _distCoeffs, OutputArray _rvec, OutputArray _tvec, bool useExtrinsicGuess, int iterationsCount, float reprojectionError, double confidence, OutputArray _inliers, int flags)
cv::Ptr< LMSolver > createLMSolver(const cv::Ptr< LMSolver::Callback > &cb, int maxIters)
virtual bool compute(cv::InputArray param, cv::OutputArray err, cv::OutputArray J) const =0
virtual void setCallback(const cv::Ptr< LMSolver::Callback > &cb)=0
int compressElems(T *ptr, const uchar *mask, int mstep, int count)
virtual bool checkSubset(cv::InputArray, cv::InputArray, int) const
virtual int run(cv::InputOutputArray _param0) const =0
Ptr< PointSetRegistrator > createLMeDSPointSetRegistrator(const Ptr< PointSetRegistrator::Callback > &_cb, int _modelPoints, double _confidence, int _maxIters)