NDEVR
API Documentation
MLPnPsolver

Solves the Perspective-n-Point problem using the MLPnP algorithm with RANSAC. More...

Public Types

typedef Eigen::Vector3< g_type > bearingVector_t
 A 3-vector of unit length used to describe landmark observations/bearings in camera frames (always expressed in camera frames).
typedef Buffer< bearingVector_tbearingVectors_t
 An array of bearing-vectors.
typedef Eigen::Matrix2< g_type > cov2_mat_t
 A 2-matrix containing the 2D covariance information of a bearing Buffer.
typedef Eigen::Matrix3< g_type > cov3_mat_t
 A 3-matrix containing the 3D covariance information of a bearing Buffer.
typedef Buffer< cov3_mat_tcov3_mats_t
 An array of 3D covariance matrices.
typedef Eigen::Vector4< g_type > point4_t
 A homogeneous 3-vector describing a point in 3D-space.
typedef Eigen::Vector3< g_type > point_t
 A 3-vector describing a point in 3D-space.
typedef Buffer< point4_tpoints4_t
 An array of homogeneous 3D-points.
typedef Buffer< point_tpoints_t
 An array of 3D-points.
typedef Eigen::Vector3< g_type > rodrigues_t
 A 3-vector containing the rodrigues parameters of a rotation matrix.
typedef Eigen::Matrix3< g_type > rotation_t
 A rotation matrix.
typedef Eigen::Matrix< g_type, 3, 4 > transformation_t
 A 3x4 transformation matrix containing rotation $ \mathbf{R} $ and translation $ \mathbf{t} $ as follows: $ \left( \begin{array}{cc} \mathbf{R} & \mathbf{t} \end{array} \right) $.
typedef Eigen::Vector3< g_type > translation_t
 A 3-vector describing a translation/camera position.

Public Member Functions

 MLPnPsolver (const Frame &F, const Buffer< MapPoint * > &vpMapPointMatches)
 Constructs the solver from a frame and map point matches.
bool iterate (uint04 nIterations, bool &bNoMore, Buffer< bool > &vbInliers, uint04 &nInliers, Eigen::Matrix4f &Tout)
 Runs RANSAC iterations to estimate the camera pose.
void SetRansacParameters (g_type probability=0.99, uint04 minInliers=8, uint04 maxIterations=300, uint04 minSet=6, float epsilon=0.4, float th2=5.991f)
 Sets RANSAC parameters.

Detailed Description

Solves the Perspective-n-Point problem using the MLPnP algorithm with RANSAC.

Given 2D-3D correspondences (bearing vectors and 3D points), estimates the camera pose using a maximum-likelihood formulation of PnP.

Definition at line 15 of file MLPnPsolver.h.

Constructor & Destructor Documentation

◆ MLPnPsolver()

MLPnPsolver::MLPnPsolver ( const Frame & F,
const Buffer< MapPoint * > & vpMapPointMatches )

Constructs the solver from a frame and map point matches.

Parameters
[in]FThe frame containing 2D observations.
[in]vpMapPointMatchesMatched map points (nullptr for unmatched).

Member Function Documentation

◆ iterate()

bool MLPnPsolver::iterate ( uint04 nIterations,
bool & bNoMore,
Buffer< bool > & vbInliers,
uint04 & nInliers,
Eigen::Matrix4f & Tout )

Runs RANSAC iterations to estimate the camera pose.

Parameters
[in]nIterationsNumber of iterations to run.
[out]bNoMoreTrue if all iterations have been exhausted.
[out]vbInliersInlier flags per correspondence.
[out]nInliersNumber of inliers found.
[out]ToutThe estimated 4x4 transformation matrix.
Returns
True if a valid solution was found.

◆ SetRansacParameters()

void MLPnPsolver::SetRansacParameters ( g_type probability = 0.99,
uint04 minInliers = 8,
uint04 maxIterations = 300,
uint04 minSet = 6,
float epsilon = 0.4,
float th2 = 5.991f )

Sets RANSAC parameters.

Parameters
[in]probabilitySuccess probability.
[in]minInliersMinimum inlier count.
[in]maxIterationsMaximum RANSAC iterations.
[in]minSetMinimum sample set size.
[in]epsilonExpected inlier ratio.
[in]th2Chi-squared threshold for inlier classification.

The documentation for this class was generated from the following file: