MRPT  2.0.4
List of all members | Public Member Functions | Private Member Functions | Private Attributes
mrpt::vision::pnp::dls Class Reference

Detailed Description

Author
Chandra Mangipudi
Date
12/08/16

Definition at line 30 of file dls.h.

#include <pnp/dls.h>

Public Member Functions

 dls (const cv::Mat &opoints, const cv::Mat &ipoints)
 Constructor for DLS class. More...
 
 ~dls ()=default
 
bool compute_pose (cv::Mat &R, cv::Mat &t)
 OpenCV function for computing pose. More...
 

Private Member Functions

template<typename OpointType , typename IpointType >
void init_points (const cv::Mat &opoints, const cv::Mat &ipoints)
 Initialization of object points and image points. More...
 
cv::Mat LeftMultVec (const cv::Mat &v)
 Create a matrix from vector. More...
 
void run_kernel (const cv::Mat &pp)
 Main function to run DLS-PnP. More...
 
void build_coeff_matrix (const cv::Mat &pp, cv::Mat &Mtilde, cv::Mat &D)
 Build the Maucaulay matrix co-efficients. More...
 
void compute_eigenvec (const cv::Mat &Mtilde, cv::Mat &eigenval_real, cv::Mat &eigenval_imag, cv::Mat &eigenvec_real, cv::Mat &eigenvec_imag)
 Eigen Value Decomposition. More...
 
void fill_coeff (const cv::Mat *D)
 Fill the hessian functions. More...
 
cv::Mat cayley_LS_M (const std::vector< double > &a, const std::vector< double > &b, const std::vector< double > &c, const std::vector< double > &u)
 Fill the Maucaulay matrix with co-efficients. More...
 
cv::Mat Hessian (const double s[])
 Compute the Hessian matrix for the polynomial co-efficient vector s. More...
 
cv::Mat cayley2rotbar (const cv::Mat &s)
 Cayley parameters to Rotation Matrix. More...
 
cv::Mat skewsymm (const cv::Mat *X1)
 Create a skwy-symmetric matrix from a vector. More...
 
cv::Mat rotx (const double t)
 Rotation matrix along x-axis by angle t. More...
 
cv::Mat roty (const double t)
 Rotation matrix along y-axis by angle t. More...
 
cv::Mat rotz (const double t)
 Rotation matrix along z-axis by angle t. More...
 
cv::Mat mean (const cv::Mat &M)
 Column-wise mean of matrix M. More...
 
bool is_empty (const cv::Mat *v)
 Check for negative values in vector v. More...
 
bool positive_eigenvalues (const cv::Mat *eigenvalues)
 check for positive eigenvalues More...
 

Private Attributes

cv::Mat p
 
cv::Mat z
 
cv::Mat mn
 
int N
 object-image points More...
 
std::vector< double > f1coeff
 number of input points More...
 
std::vector< double > f2coeff
 
std::vector< double > f3coeff
 
std::vector< double > cost_
 
std::vector< cv::Mat > C_est_
 coefficient for coefficients matrix More...
 
std::vector< cv::Mat > t_est_
 
cv::Mat C_est__
 optimal candidates More...
 
cv::Mat t_est__
 
double cost__
 optimal found solution More...
 

Constructor & Destructor Documentation

◆ dls()

mrpt::vision::pnp::dls::dls ( const cv::Mat &  opoints,
const cv::Mat &  ipoints 
)

Constructor for DLS class.

Definition at line 20 of file dls.cpp.

References cost__, f1coeff, f2coeff, f3coeff, mn, N, p, and z.

◆ ~dls()

mrpt::vision::pnp::dls::~dls ( )
default

Member Function Documentation

◆ build_coeff_matrix()

void mrpt::vision::pnp::dls::build_coeff_matrix ( const cv::Mat &  pp,
cv::Mat &  Mtilde,
cv::Mat &  D 
)
private

Build the Maucaulay matrix co-efficients.

Parameters
[in]pp
[out]Mtilde
[out]D

Definition at line 204 of file dls.cpp.

◆ cayley2rotbar()

cv::Mat mrpt::vision::pnp::dls::cayley2rotbar ( const cv::Mat &  s)
private

Cayley parameters to Rotation Matrix.

Parameters
[in]s
Returns
Rotation Matrix

Definition at line 2724 of file dls.cpp.

◆ cayley_LS_M()

cv::Mat mrpt::vision::pnp::dls::cayley_LS_M ( const std::vector< double > &  a,
const std::vector< double > &  b,
const std::vector< double > &  c,
const std::vector< double > &  u 
)
private

Fill the Maucaulay matrix with co-efficients.

Parameters
[in]a
[in]b
[in]c
[in]u
Returns
Maucaulay matrix M

Definition at line 606 of file dls.cpp.

◆ compute_eigenvec()

void mrpt::vision::pnp::dls::compute_eigenvec ( const cv::Mat &  Mtilde,
cv::Mat &  eigenval_real,
cv::Mat &  eigenval_imag,
cv::Mat &  eigenvec_real,
cv::Mat &  eigenvec_imag 
)
private

Eigen Value Decomposition.

Parameters
MtildeMatrix to be decomposed
eigenval_realReal eigenvalues
eigenval_imagImaginary eigenvalues
eigenvec_realEigen Vectors corresponding to real eigen values
eigenvec_imagEigen Vectors corresponding to imaginary eigen values

Definition at line 265 of file dls.cpp.

◆ compute_pose()

bool mrpt::vision::pnp::dls::compute_pose ( cv::Mat &  R,
cv::Mat &  t 
)

OpenCV function for computing pose.

Definition at line 47 of file dls.cpp.

References CV_PI, and R.

Referenced by mrpt::vision::pnp::CPnP::dls().

Here is the caller graph for this function:

◆ fill_coeff()

void mrpt::vision::pnp::dls::fill_coeff ( const cv::Mat *  D)
private

Fill the hessian functions.

Parameters
[in]D

Definition at line 298 of file dls.cpp.

◆ Hessian()

cv::Mat mrpt::vision::pnp::dls::Hessian ( const double  s[])
private

Compute the Hessian matrix for the polynomial co-efficient vector s.

Parameters
[in]s
Returns

Definition at line 2588 of file dls.cpp.

◆ init_points()

template<typename OpointType , typename IpointType >
void mrpt::vision::pnp::dls::init_points ( const cv::Mat &  opoints,
const cv::Mat &  ipoints 
)
inlineprivate

Initialization of object points and image points.

Parameters
[in]opoints
[in]ipoints

Definition at line 47 of file dls.h.

References mn, N, p, and z.

◆ is_empty()

bool mrpt::vision::pnp::dls::is_empty ( const cv::Mat *  v)
private

Check for negative values in vector v.

Parameters
[in]v
Returns
False if v[i] < 0 else True

Definition at line 2773 of file dls.cpp.

◆ LeftMultVec()

cv::Mat mrpt::vision::pnp::dls::LeftMultVec ( const cv::Mat &  v)
private

Create a matrix from vector.

Parameters
[in]v
Returns
Matrix containing vector v as columns

Definition at line 593 of file dls.cpp.

◆ mean()

cv::Mat mrpt::vision::pnp::dls::mean ( const cv::Mat &  M)
private

Column-wise mean of matrix M.

Parameters
[in]M
Returns
Mean vector

Definition at line 2766 of file dls.cpp.

◆ positive_eigenvalues()

bool mrpt::vision::pnp::dls::positive_eigenvalues ( const cv::Mat *  eigenvalues)
private

check for positive eigenvalues

Parameters
[in]eigenvalues
Returns
True if positivie eigenvalues are found else False

Definition at line 2784 of file dls.cpp.

◆ rotx()

cv::Mat mrpt::vision::pnp::dls::rotx ( const double  t)
private

Rotation matrix along x-axis by angle t.

Parameters
[in]t
Returns
Rotation Matrix

Definition at line 2742 of file dls.cpp.

◆ roty()

cv::Mat mrpt::vision::pnp::dls::roty ( const double  t)
private

Rotation matrix along y-axis by angle t.

Parameters
[in]t
Returns
Rotation Matrix

Definition at line 2750 of file dls.cpp.

◆ rotz()

cv::Mat mrpt::vision::pnp::dls::rotz ( const double  t)
private

Rotation matrix along z-axis by angle t.

Parameters
[in]t
Returns
Rotation Matrix

Definition at line 2758 of file dls.cpp.

◆ run_kernel()

void mrpt::vision::pnp::dls::run_kernel ( const cv::Mat &  pp)
private

Main function to run DLS-PnP.

Parameters
[in]pp

Definition at line 89 of file dls.cpp.

References mrpt::obs::gnss::b2.

◆ skewsymm()

cv::Mat mrpt::vision::pnp::dls::skewsymm ( const cv::Mat *  X1)
private

Create a skwy-symmetric matrix from a vector.

Parameters
[in]X1
Returns
Skew-symmetric matrix

Definition at line 2734 of file dls.cpp.

Member Data Documentation

◆ C_est_

std::vector<cv::Mat> mrpt::vision::pnp::dls::C_est_
private

coefficient for coefficients matrix

Definition at line 195 of file dls.h.

◆ C_est__

cv::Mat mrpt::vision::pnp::dls::C_est__
private

optimal candidates

Definition at line 196 of file dls.h.

◆ cost_

std::vector<double> mrpt::vision::pnp::dls::cost_
private

Definition at line 193 of file dls.h.

◆ cost__

double mrpt::vision::pnp::dls::cost__
private

optimal found solution

Definition at line 197 of file dls.h.

Referenced by dls().

◆ f1coeff

std::vector<double> mrpt::vision::pnp::dls::f1coeff
private

number of input points

Definition at line 193 of file dls.h.

Referenced by dls().

◆ f2coeff

std::vector<double> mrpt::vision::pnp::dls::f2coeff
private

Definition at line 193 of file dls.h.

Referenced by dls().

◆ f3coeff

std::vector<double> mrpt::vision::pnp::dls::f3coeff
private

Definition at line 193 of file dls.h.

Referenced by dls().

◆ mn

cv::Mat mrpt::vision::pnp::dls::mn
private

Definition at line 191 of file dls.h.

Referenced by dls(), and init_points().

◆ N

int mrpt::vision::pnp::dls::N
private

object-image points

Definition at line 192 of file dls.h.

Referenced by dls(), and init_points().

◆ p

cv::Mat mrpt::vision::pnp::dls::p
private

Definition at line 191 of file dls.h.

Referenced by dls(), and init_points().

◆ t_est_

std::vector<cv::Mat> mrpt::vision::pnp::dls::t_est_
private

Definition at line 195 of file dls.h.

◆ t_est__

cv::Mat mrpt::vision::pnp::dls::t_est__
private

Definition at line 196 of file dls.h.

◆ z

cv::Mat mrpt::vision::pnp::dls::z
private

Definition at line 191 of file dls.h.

Referenced by dls(), and init_points().




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