Commit 42ab7fd8 authored by edgarriba's avatar edgarriba

dls() no compiles

parent fb67ab12
This diff is collapsed.
#ifndef dls_h #ifndef DLS_H
#define dls_h #define DLS_H
#include "opencv2/core/core_c.h" #include "precomp.hpp"
class dls class dls
{ {
public: public:
dls(); dls(const cv::Mat& opoints, const cv::Mat& ipoints);
~dls(); ~dls();
private: void init_vectors(const cv::Mat& opoints, const cv::Mat& ipoints);
void build_coeff_mattrix();
cv::Mat LeftMultVec(const cv::Mat& v);
cv::Mat cayley_LS_M(const std::vector<double>& a, const std::vector<double>& b, const std::vector<double>& c, const std::vector<double>& u);
private:
cv::Mat H; // coeff matrix
cv::Mat A;
cv::Mat D_mat;
std::vector<double> f1coeff;
std::vector<double> f2coeff;
std::vector<double> f3coeff;
cv::Mat p; // object points
cv::Mat z; // image points
int N; // number of input points
}; };
#endif #endif // DLS_H
...@@ -41,10 +41,10 @@ ...@@ -41,10 +41,10 @@
//M*/ //M*/
#include "precomp.hpp" #include "precomp.hpp"
#include "dls.h"
#include "epnp.h" #include "epnp.h"
#include "p3p.h" #include "p3p.h"
#include "opencv2/calib3d/calib3d_c.h" #include "opencv2/calib3d/calib3d_c.h"
#include "dls.h"
#include <iostream> #include <iostream>
using namespace cv; using namespace cv;
...@@ -100,12 +100,13 @@ bool cv::solvePnP( InputArray _opoints, InputArray _ipoints, ...@@ -100,12 +100,13 @@ bool cv::solvePnP( InputArray _opoints, InputArray _ipoints,
cv::Mat undistortedPoints; cv::Mat undistortedPoints;
cv::undistortPoints(ipoints, undistortedPoints, cameraMatrix, distCoeffs); cv::undistortPoints(ipoints, undistortedPoints, cameraMatrix, distCoeffs);
//dls PnP;
dls PnP(opoints, undistortedPoints);
// DO SOMETHING // DO SOMETHING
cv::Mat R, rvec = _rvec.getMat(), tvec = _tvec.getMat(); cv::Mat R, rvec = _rvec.getMat(), tvec = _tvec.getMat();
return true;
} }
else else
CV_Error(CV_StsBadArg, "The flags argument must be one of CV_ITERATIVE, CV_P3P or CV_EPNP"); CV_Error(CV_StsBadArg, "The flags argument must be one of CV_ITERATIVE, CV_P3P or CV_EPNP");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment