MRPT
2.0.4
|
#include <pnp/upnp.h>
Public Member Functions | |
upnp (const cv::Mat &cameraMatrix, const cv::Mat &opoints, const cv::Mat &ipoints) | |
Constructor for UPnP class. More... | |
~upnp () | |
Destructor for UPnP class. More... | |
double | compute_pose (cv::Mat &R, cv::Mat &t) |
Function to compute pose. More... | |
Private Member Functions | |
template<typename T > | |
void | init_camera_parameters (const cv::Mat &cameraMatrix) |
Initialize camera variables using camera intrinsic matrix. More... | |
template<typename OpointType , typename IpointType > | |
void | init_points (const cv::Mat &opoints, const cv::Mat &ipoints) |
Iniialize Object points and image points from OpenCV Matrix. More... | |
double | reprojection_error (const double R[3][3], const double t[3]) |
Compute the reprojection error using the estimated Rotation matrix and Translation Vector. More... | |
void | choose_control_points () |
Function to select 4 control points. More... | |
void | compute_alphas () |
Function to comput . More... | |
void | fill_M (cv::Mat *M, const int row, const double *alphas, const double u, const double v) |
Function to compute Maucaulay matrix M. More... | |
void | compute_ccs (const double *betas, const double *ut) |
Compute the control points. More... | |
void | compute_pcs () |
Compute object points based on control points. More... | |
void | solve_for_sign () |
Internal member function. More... | |
void | find_betas_and_focal_approx_1 (cv::Mat *Ut, cv::Mat *Rho, double *betas, double *efs) |
Function to approximately calculate betas and focal length. More... | |
void | find_betas_and_focal_approx_2 (cv::Mat *Ut, cv::Mat *Rho, double *betas, double *efs) |
Function to calculate betas and focal length (more accurate) More... | |
void | qr_solve (cv::Mat *A, cv::Mat *b, cv::Mat *X) |
Function to do a QR decomposition. More... | |
cv::Mat | compute_constraint_distance_2param_6eq_2unk_f_unk (const cv::Mat &M1) |
Internal function. More... | |
cv::Mat | compute_constraint_distance_3param_6eq_6unk_f_unk (const cv::Mat &M1, const cv::Mat &M2) |
Internal function. More... | |
void | generate_all_possible_solutions_for_f_unk (const double betas[5], double solutions[18][3]) |
Get all possible solutions. More... | |
double | sign (const double v) |
Return the sign of the scalar. More... | |
double | dot (const double *v1, const double *v2) |
Compute the dot product between two vectors. More... | |
double | dotXY (const double *v1, const double *v2) |
Compute dot product in 2D with only x and y components. More... | |
double | dotZ (const double *v1, const double *v2) |
Compute the dot product using only z component. More... | |
double | dist2 (const double *p1, const double *p2) |
Compute the euclidean distance squared between two points in 3D. More... | |
void | compute_rho (double *rho) |
Internal fucntion. More... | |
void | compute_L_6x12 (const double *ut, double *l_6x12) |
Internal function. More... | |
void | gauss_newton (const cv::Mat *L_6x12, const cv::Mat *Rho, double current_betas[4], double *efs) |
Gauss Newton Iterative optimization. More... | |
void | compute_A_and_b_gauss_newton (const double *l_6x12, const double *rho, const double cb[4], cv::Mat *A, cv::Mat *b, double const f) |
Compute matrix A and vector b. More... | |
double | compute_R_and_t (const double *ut, const double *betas, double R[3][3], double t[3]) |
Function to compute the pose. More... | |
void | estimate_R_and_t (double R[3][3], double t[3]) |
Helper function to function 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]) |
Function to copy the pose. 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 |
Object points. More... | |
std::vector< double > | alphas |
Image points. More... | |
std::vector< double > | pcs |
int | number_of_correspondences |
Internal variable. More... | |
double | cws [4][3] |
Number of 2d/3d correspondences. More... | |
double | ccs [4][3] |
int | max_nr |
Control point variables. More... | |
double * | A1 |
Internal variable. More... | |
double * | A2 |
upnp::upnp | ( | const cv::Mat & | cameraMatrix, |
const cv::Mat & | opoints, | ||
const cv::Mat & | ipoints | ||
) |
upnp::~upnp | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
double upnp::compute_pose | ( | cv::Mat & | R, |
cv::Mat & | t | ||
) |
Function to compute pose.
[out] | R | Rotation Matrix |
[out] | t | Translation Vector |
Definition at line 116 of file upnp.cpp.
References R.
Referenced by mrpt::vision::pnp::CPnP::upnp().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Helper function to function compute_R_and_t()
[out] | R | Rotaiton matrix |
[out] | t | Translation vector |
Definition at line 179 of file upnp.cpp.
References R.
|
private |
|
private |
|
private |
|
private |
|
private |
Get all possible solutions.
[in] | betas | |
[out] | solutions |
Definition at line 603 of file upnp.cpp.
References mrpt::sign().
|
inlineprivate |
|
inlineprivate |
Iniialize Object points and image points from OpenCV Matrix.
[in] | opoints | Object Points |
[in] | ipoints | Image Points |
Definition at line 124 of file upnp.h.
References number_of_correspondences, pws, and us.
|
private |
Function to do a QR decomposition.
[in] | A | Matrix to be decomposed |
[out] | b | |
[out] | X |
Definition at line 800 of file upnp.cpp.
References mrpt::obs::gnss::A1, and mrpt::math::sum().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Image center in y-direction.
Definition at line 345 of file upnp.h.
Referenced by init_camera_parameters().
|
private |
Focal length in x-direction.
Definition at line 346 of file upnp.h.
Referenced by init_camera_parameters().
|
private |
|
private |
|
private |
|
private |
Definition at line 343 of file upnp.h.
Referenced by init_camera_parameters().
|
private |
|
private |
Image center in x-direction.
Definition at line 344 of file upnp.h.
Referenced by init_camera_parameters().
Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020 |