- Author
 - Chandra Mangipudi 
 
- Date
 - 11/08/16 
 
Definition at line 32 of file p3p.h.
 
 | 
|   | p3p (double fx, double fy, double cx, double cy) | 
|   | Constructor for p3p class using C.  More...
  | 
|   | 
|   | p3p (Eigen::MatrixXd cam_intrinsic) | 
|   | Constructor using Eigen matrix.  More...
  | 
|   | 
|   | p3p (cv::Mat cameraMatrix) | 
|   | Constructor using OpenCV matrix.  More...
  | 
|   | 
| bool  | solve (cv::Mat &R, cv::Mat &tvec, const cv::Mat &opoints, const cv::Mat &ipoints) | 
|   | Function to compute pose by P3P using OpenCV.  More...
  | 
|   | 
| bool  | solve (Eigen::Ref< Eigen::Matrix3d > R, Eigen::Ref< Eigen::Vector3d > t, Eigen::MatrixXd obj_pts, Eigen::MatrixXd img_pts) | 
|   | 
| int  | solve (double R[4][3][3], double t[4][3], double mu0, double mv0, double X0, double Y0, double Z0, double mu1, double mv1, double X1, double Y1, double Z1, double mu2, double mv2, double X2, double Y2, double Z2) | 
|   | Function to compute pose from 3 points using C function.  More...
  | 
|   | 
| bool  | solve (double R[3][3], double t[3], double mu0, double mv0, double X0, double Y0, double Z0, double mu1, double mv1, double X1, double Y1, double Z1, double mu2, double mv2, double X2, double Y2, double Z2, double mu3, double mv3, double X3, double Y3, double Z3) | 
|   | Function to compute pose from 4 points using C function.  More...
  | 
|   | 
 | 
| template<typename T >  | 
| void  | init_camera_parameters (const cv::Mat &cameraMatrix) | 
|   | OpenCV Initialization function to access camera intrinsic matrix.  More...
  | 
|   | 
| template<typename OpointType , typename IpointType >  | 
| void  | extract_points (const cv::Mat &opoints, const cv::Mat &ipoints, std::vector< double > &points) | 
|   | OpoenCV wrapper for extracting object and image points.  More...
  | 
|   | 
| void  | extract_points (Eigen::MatrixXd obj_pts, Eigen::MatrixXd img_pts, std::vector< double > &points) | 
|   | Eigen wrapper for extracting object and image points.  More...
  | 
|   | 
| void  | init_inverse_parameters () | 
|   | Function to compute inverse parameters of camera intrinsic matrix.  More...
  | 
|   | 
| int  | solve_for_lengths (double lengths[4][3], double distances[3], double cosines[3]) | 
|   | Helper function to  solve()  More...
  | 
|   | 
| bool  | align (double M_start[3][3], double X0, double Y0, double Z0, double X1, double Y1, double Z1, double X2, double Y2, double Z2, double R[3][3], double T[3]) | 
|   | 
| bool  | jacobi_4x4 (double *A, double *D, double *U) | 
|   | Function used to compute the SVD.  More...
  | 
|   | 
template<typename OpointType , typename IpointType > 
  
  
      
        
          | void mrpt::vision::pnp::p3p::extract_points  | 
          ( | 
          const cv::Mat &  | 
          opoints,  | 
         
        
           | 
           | 
          const cv::Mat &  | 
          ipoints,  | 
         
        
           | 
           | 
          std::vector< double > &  | 
          points  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlineprivate   | 
  
 
OpoenCV wrapper for extracting object and image points. 
- Parameters
 - 
  
    | [in] | opoints | Object points (OpenCV Mat)  | 
    | [in] | ipoints | Image points (OpenCV Mat)  | 
    | [out] | points | Combination of object and image points (C structure)  | 
  
   
Definition at line 141 of file p3p.h.
References cx, cy, fx, and fy.
 
 
  
  
      
        
          | void mrpt::vision::pnp::p3p::init_inverse_parameters  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
 
  
  
      
        
          | int mrpt::vision::pnp::p3p::solve_for_lengths  | 
          ( | 
          double  | 
          lengths[4][3],  | 
         
        
           | 
           | 
          double  | 
          distances[3],  | 
         
        
           | 
           | 
          double  | 
          cosines[3]  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
private   | 
  
 
Helper function to  solve() 
Given 3D distances between three points and cosines of 3 angles at the apex, calculates the lentghs of the line segments connecting projection center (P) and the three 3D points (A, B, C).
- Parameters
 - 
  
    | [out] | lengths | Internal lengths used for P3P  | 
    | [in] | distances | Internal distances used for computation of lengths  | 
    | [in] | cosines | Internal cosines used for computation of lengths  | 
  
   
- Returns
 
Returned distances are for |PA|, |PB|, |PC| respectively. Only the solution to the main branch. Reference : X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang; "Complete Solution
Classification for the Perspective-Three-Point Problem" IEEE Trans. on PAMI, vol. 25, No. 8, August 2003 
- Parameters
 - 
  
    | lengths3D | Lengths of line segments up to four solutions.  | 
    | dist3D | Distance between 3D points in pairs |BC|, |AC|, |AB|.  | 
    | cosines | Cosine of the angles /_BPC, /_APC, /_APB.  | 
  
   
- Returns
 - Number of solutions. WARNING: NOT ALL THE DEGENERATE CASES ARE IMPLEMENTED 
 
Definition at line 233 of file p3p.cpp.
References mrpt::obs::gnss::a2, mrpt::obs::gnss::b0, mrpt::obs::gnss::b1, mrpt::obs::gnss::b2, and solve_deg4().