54 #include <opencv2/core/core.hpp> 63 PnPsolver(
const Frame &F,
const vector<MapPoint*> &vpMapPointMatches);
67 void SetRansacParameters(
double probability = 0.99,
int minInliers = 8 ,
int maxIterations = 300,
int minSet = 4,
float epsilon = 0.4,
70 cv::Mat find(vector<bool> &vbInliers,
int &nInliers);
72 cv::Mat iterate(
int nIterations,
bool &bNoMore, vector<bool> &vbInliers,
int &nInliers);
80 void set_maximum_number_of_correspondences(
const int n);
81 void reset_correspondences(
void);
82 void add_correspondence(
const double X,
const double Y,
const double Z,
83 const double u,
const double v);
85 double compute_pose(
double R[3][3],
double T[3]);
87 void relative_error(
double & rot_err,
double & transl_err,
88 const double Rtrue[3][3],
const double ttrue[3],
89 const double Rest[3][3],
const double test[3]);
91 void print_pose(
const double R[3][3],
const double t[3]);
92 double reprojection_error(
const double R[3][3],
const double t[3]);
94 void choose_control_points(
void);
95 void compute_barycentric_coordinates(
void);
96 void fill_M(CvMat * M,
const int row,
const double * alphas,
const double u,
const double v);
97 void compute_ccs(
const double * betas,
const double * ut);
98 void compute_pcs(
void);
100 void solve_for_sign(
void);
102 void find_betas_approx_1(
const CvMat * L_6x10,
const CvMat * Rho,
double * betas);
103 void find_betas_approx_2(
const CvMat * L_6x10,
const CvMat * Rho,
double * betas);
104 void find_betas_approx_3(
const CvMat * L_6x10,
const CvMat * Rho,
double * betas);
105 void qr_solve(CvMat * A, CvMat * b, CvMat * X);
107 double dot(
const double * v1,
const double * v2);
108 double dist2(
const double * p1,
const double * p2);
110 void compute_rho(
double * rho);
111 void compute_L_6x10(
const double * ut,
double * l_6x10);
113 void gauss_newton(
const CvMat * L_6x10,
const CvMat * Rho,
double current_betas[4]);
114 void compute_A_and_b_gauss_newton(
const double * l_6x10,
const double * rho,
115 double cb[4], CvMat * A, CvMat * b);
117 double compute_R_and_t(
const double * ut,
const double * betas,
118 double R[3][3],
double t[3]);
120 void estimate_R_and_t(
double R[3][3],
double t[3]);
122 void copy_R_and_t(
const double R_dst[3][3],
const double t_dst[3],
123 double R_src[3][3],
double t_src[3]);
125 void mat_to_quat(
const double R[3][3],
double q[4]);
128 double uc, vc, fu, fv;
130 double * pws, * us, * alphas, * pcs;
131 int maximum_number_of_correspondences;
132 int number_of_correspondences;
134 double cws[4][3], ccs[4][3];
135 double cws_determinant;
137 vector<MapPoint*> mvpMapPointMatches;
140 vector<cv::Point2f> mvP2D;
141 vector<float> mvSigma2;
144 vector<cv::Point3f> mvP3Dw;
147 vector<size_t> mvKeyPointIndices;
153 vector<bool> mvbInliersi;
158 vector<bool> mvbBestInliers;
164 vector<bool> mvbRefinedInliers;
165 int mnRefinedInliers;
171 vector<size_t> mvAllIndices;
177 int mRansacMinInliers;
183 float mRansacEpsilon;
192 vector<float> mvMaxError;
Definition: Converter.cpp:24
Definition: PnPsolver.h:61