#include <pnp/epnp.h>
Public Member Functions | |
epnp (const cv::Mat &cameraMatrix, const cv::Mat &opoints, const cv::Mat &ipoints) | |
Constructor for EPnP class. More... | |
~epnp () | |
Destructor for EPnP class. More... | |
void | add_correspondence (const double X, const double Y, const double Z, const double u, const double v) |
Add a 2d/3d correspondence. More... | |
void | compute_pose (cv::Mat &R, cv::Mat &t) |
OpenCV wrapper to compute pose. More... | |
Private Member Functions | |
template<typename T > | |
void | init_camera_parameters (const cv::Mat &cameraMatrix) |
Initialize Camera Matrix. More... | |
template<typename OpointType , typename IpointType > | |
void | init_points (const cv::Mat &opoints, const cv::Mat &ipoints) |
Convert object points and image points from OpenCV format to STL matrices. More... | |
double | reprojection_error (const double R[3][3], const double t[3]) |
Function to compute reprojection error. More... | |
void | choose_control_points (void) |
Function to select 4 control points from n points. More... | |
void | compute_barycentric_coordinates (void) |
Convert from object space to relative object space (Barycentric coordinates) More... | |
void | fill_M (CvMat *M, const int row, const double *alphas, const double u, const double v) |
Generate the Matrix M. More... | |
void | compute_ccs (const double *betas, const double *ut) |
Internal function. More... | |
void | compute_pcs (void) |
Internal function. More... | |
void | solve_for_sign (void) |
Internal function. More... | |
void | find_betas_approx_1 (const CvMat *L_6x10, const CvMat *Rho, double *betas) |
Internal function. More... | |
void | find_betas_approx_2 (const CvMat *L_6x10, const CvMat *Rho, double *betas) |
Internal function. More... | |
void | find_betas_approx_3 (const CvMat *L_6x10, const CvMat *Rho, double *betas) |
Internal function. More... | |
void | qr_solve (CvMat *A, CvMat *b, CvMat *X) |
QR optimization algorithm. More... | |
double | dot (const double *v1, const double *v2) |
Dot product of two OpenCV vectors. More... | |
double | dist2 (const double *p1, const double *p2) |
Squared distance between two vectors. More... | |
void | compute_rho (double *rho) |
Get distances between all object points taken 2 at a time(nC2) More... | |
void | compute_L_6x10 (const double *ut, double *l_6x10) |
Internal function. More... | |
void | gauss_newton (const CvMat *L_6x10, const CvMat *Rho, double current_betas[4]) |
Gauss Newton iterative algorithm. More... | |
void | compute_A_and_b_gauss_newton (const double *l_6x10, const double *rho, const double cb[4], CvMat *A, CvMat *b) |
Internal function. More... | |
double | compute_R_and_t (const double *ut, const double *betas, double R[3][3], double t[3]) |
Function to compute pose. More... | |
void | estimate_R_and_t (double R[3][3], double t[3]) |
Helper function to compute_R_and_t() More... | |
void | copy_R_and_t (const double R_dst[3][3], const double t_dst[3], double R_src[3][3], double t_src[3]) |
Copy function of output result. More... | |
Private Attributes | |
double | uc |
double | vc |
Image center in x-direction. More... | |
double | fu |
Image center in y-direction. More... | |
double | fv |
Focal length in x-direction. More... | |
std::vector< double > | pws |
Focal length in y-direction. More... | |
std::vector< double > | us |
std::vector< double > | alphas |
std::vector< double > | pcs |
int | number_of_correspondences |
Internal member variables. More... | |
double | cws [4][3] |
Number of 2d/3d correspondences. More... | |
double | ccs [4][3] |
double | cws_determinant |
Internal member variables. More... | |
int | max_nr |
Internal member variable. More... | |
double * | A1 |
Internal member variable. More... | |
double * | A2 |
mrpt::vision::pnp::epnp::epnp | ( | const cv::Mat & | cameraMatrix, |
const cv::Mat & | opoints, | ||
const cv::Mat & | ipoints | ||
) |
Constructor for EPnP class.
mrpt::vision::pnp::epnp::~epnp | ( | ) |
Destructor for EPnP class.
void mrpt::vision::pnp::epnp::add_correspondence | ( | const double | X, |
const double | Y, | ||
const double | Z, | ||
const double | u, | ||
const double | v | ||
) |
Add a 2d/3d correspondence.
[in] | X | X coordinate in Camera coordinate system |
[in] | Y | Y coordinate in Camera coordinate system |
[in] | Z | Z coordinate in Camera coordinate system |
[in] | u | Image pixel coordinate u in x axis |
[in] | v | Image pixel coordinate v in y axis |
Function to select 4 control points from n points.
|
private |
Internal function.
[in] | l_6x10 | |
[in] | rho | |
[in] | cb | |
[out] | A | |
[out] | b |
Convert from object space to relative object space (Barycentric coordinates)
|
private |
Internal function.
[in] | betas | |
[in] | ut |
|
private |
Internal function.
[in] | ut | |
[out] | l_6x10 |
void mrpt::vision::pnp::epnp::compute_pose | ( | cv::Mat & | R, |
cv::Mat & | t | ||
) |
OpenCV wrapper to compute pose.
[out] | R | Rotation Matrix |
[out] | t | Translation Vector |
Referenced by mrpt::vision::pnp::CPnP::epnp().
|
private |
Function to compute pose.
[in] | ut | |
[in] | betas | |
[out] | R | |
[out] | t |
|
private |
Get distances between all object points taken 2 at a time(nC2)
rho |
|
private |
Copy function of output result.
[out] | R_dst | |
[out] | t_dst | |
[in] | R_src | |
[in] | t_src |
|
private |
Squared distance between two vectors.
[in] | p1 | |
[in] | p2 |
|
private |
Dot product of two OpenCV vectors.
[in] | v1 | |
[in] | v2 |
|
private |
Helper function to compute_R_and_t()
R | |
t |
|
private |
Generate the Matrix M.
[out] | M | |
[in] | row | |
[in] | alphas | |
[in] | u | |
[in] | v |
|
private |
Internal function.
[out] | L_6x10 | |
[in] | Rho | |
[in] | betas |
|
private |
Internal function.
[out] | L_6x10 | |
[in] | Rho | |
[in] | betas |
|
private |
Internal function.
[out] | L_6x10 | |
[in] | Rho | |
[in] | betas |
|
private |
Gauss Newton iterative algorithm.
[in] | L_6x10 | |
[in] | Rho | |
[in,out] | current_betas |
|
inlineprivate |
|
inlineprivate |
|
private |
QR optimization algorithm.
[in] | A | |
[out] | b | |
[out] | X |
|
private |
Function to compute reprojection error.
R | Rotation Matrix |
t | Translation Vector |
|
private |
|
private |
|
private |
|
private |
Image center in y-direction.
Definition at line 250 of file epnp.h.
Referenced by init_camera_parameters(), and init_points().
|
private |
Focal length in x-direction.
Definition at line 251 of file epnp.h.
Referenced by init_camera_parameters(), and init_points().
|
private |
|
private |
|
private |
|
private |
Definition at line 248 of file epnp.h.
Referenced by init_camera_parameters(), and init_points().
|
private |
Definition at line 253 of file epnp.h.
Referenced by init_points().
|
private |
Image center in x-direction.
Definition at line 249 of file epnp.h.
Referenced by init_camera_parameters(), and init_points().
Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019 |