This class represent a pinhole camera model for Monocular SLAM and implements some associated Jacobians.
The camera parameters are accessible in the public member CCamModel::cam
Definition at line 50 of file CCamModel.h.
#include <mrpt/vision/CCamModel.h>
Classes | |
struct | CameraTempVariables |
Public Member Functions | |
CCamModel () | |
Default Constructor. | |
void | loadFromConfigFile (const mrpt::utils::CConfigFileBase &source, const std::string §ion) |
This method loads the options from a ".ini"-like file or memory-stored string list. | |
void | dumpToTextStream (CStream &out) const |
This method displays clearly all the contents of the structure in textual form, sending it to a CStream. | |
CCamModel (const mrpt::utils::CConfigFileBase &cfgIni) | |
Constructor from a ini file. | |
void | jacob_undistor_fm (const mrpt::vision::TPixelCoordf &uvd, math::CMatrixDouble &J_undist) |
Jacobian for undistortion the image coordinates. | |
void | jacob_undistor (const mrpt::vision::TPixelCoordf &p, mrpt::math::CMatrixDouble &J_undist) |
Calculate the image coordinates undistorted. | |
void | distort_a_point (const mrpt::vision::TPixelCoordf &p, mrpt::vision::TPixelCoordf &distorted_p) |
Return the pixel position distorted by the camera. | |
void | undistort_point (const mrpt::vision::TPixelCoordf &p, mrpt::vision::TPixelCoordf &undistorted_p) |
Return the pixel position undistorted by the camera The input values 'col' and 'row' will be replace for the new values (undistorted) | |
void | project_3D_point (const mrpt::math::TPoint3D &p3D, mrpt::vision::TPixelCoordf &distorted_p) const |
Return the (distorted) pixel position of a 3D point given in coordinates relative to the camera (+Z pointing forward, +X to the right) | |
void | unproject_3D_point (const mrpt::vision::TPixelCoordf &distorted_p, mrpt::math::TPoint3D &p3D) const |
Return the 3D location of a point (at a fixed distance z=1), for the given (distorted) pixel position. | |
void | jacobian_project_with_distortion (const mrpt::math::TPoint3D &p3D, math::CMatrixDouble &dh_dy) const |
Jacobian of the projection of 3D points (with distortion), as done in project_3D_point ![]() | |
void | jacobian_unproject_with_distortion (const mrpt::vision::TPixelCoordf &p, math::CMatrixDouble &dy_dh) const |
template<typename T , typename POINT > | |
void | getTemporaryVariablesForTransform (const POINT &p, CameraTempVariables< T > &v) const |
template<typename T , typename POINT , typename PIXEL > | |
void | getFullProjection (const POINT &pIn, PIXEL &pOut) const |
template<typename T , typename PIXEL > | |
void | getFullProjectionT (const CameraTempVariables< T > &tmp, PIXEL &pOut) const |
template<typename T , typename POINT , typename MATRIX > | |
void | getFullJacobian (const POINT &pIn, MATRIX &mOut) const |
template<typename T , typename POINT , typename MATRIX > | |
void | getFullJacobianT (const POINT &pIn, const CameraTempVariables< T > &tmp, MATRIX &mOut) const |
template<typename POINTIN , typename POINTOUT , typename MAT22 > | |
void | getFullInverseModelWithJacobian (const POINTIN &pIn, POINTOUT &pOut, MAT22 &jOut) const |
Public Attributes | |
mrpt::utils::TCamera | cam |
The parameters of a camera. | |
Private Member Functions | |
CMatrixFixedNumeric< double, 2, 2 > | firstInverseJacobian () const |
CMatrixFixedNumeric< double, 4, 2 > | secondInverseJacobian () const |
CMatrixFixedNumeric< double, 3, 4 > | thirdInverseJacobian () const |
mrpt::vision::CCamModel::CCamModel | ( | ) |
Default Constructor.
mrpt::vision::CCamModel::CCamModel | ( | const mrpt::utils::CConfigFileBase & | cfgIni | ) |
Constructor from a ini file.
void mrpt::vision::CCamModel::distort_a_point | ( | const mrpt::vision::TPixelCoordf & | p, |
mrpt::vision::TPixelCoordf & | distorted_p | ||
) |
Return the pixel position distorted by the camera.
void mrpt::vision::CCamModel::dumpToTextStream | ( | CStream & | out | ) | const [virtual] |
This method displays clearly all the contents of the structure in textual form, sending it to a CStream.
Implements mrpt::utils::CLoadableOptions.
CMatrixFixedNumeric<double,2,2> mrpt::vision::CCamModel::firstInverseJacobian | ( | ) | const [inline, private] |
Definition at line 223 of file CCamModel.h.
void mrpt::vision::CCamModel::getFullInverseModelWithJacobian | ( | const POINTIN & | pIn, |
POINTOUT & | pOut, | ||
MAT22 & | jOut | ||
) | const [inline] |
Definition at line 250 of file CCamModel.h.
References square().
void mrpt::vision::CCamModel::getFullJacobian | ( | const POINT & | pIn, |
MATRIX & | mOut | ||
) | const [inline] |
Definition at line 178 of file CCamModel.h.
void mrpt::vision::CCamModel::getFullJacobianT | ( | const POINT & | pIn, |
const CameraTempVariables< T > & | tmp, | ||
MATRIX & | mOut | ||
) | const [inline] |
void mrpt::vision::CCamModel::getFullProjection | ( | const POINT & | pIn, |
PIXEL & | pOut | ||
) | const [inline] |
Definition at line 167 of file CCamModel.h.
void mrpt::vision::CCamModel::getFullProjectionT | ( | const CameraTempVariables< T > & | tmp, |
PIXEL & | pOut | ||
) | const [inline] |
Definition at line 173 of file CCamModel.h.
References mrpt::vision::CCamModel::CameraTempVariables< T >::x__, and mrpt::vision::CCamModel::CameraTempVariables< T >::y__.
void mrpt::vision::CCamModel::getTemporaryVariablesForTransform | ( | const POINT & | p, |
CameraTempVariables< T > & | v | ||
) | const [inline] |
Definition at line 155 of file CCamModel.h.
References mrpt::vision::CCamModel::CameraTempVariables< T >::K, mrpt::vision::CCamModel::CameraTempVariables< T >::R, square(), mrpt::vision::CCamModel::CameraTempVariables< T >::x_, mrpt::vision::CCamModel::CameraTempVariables< T >::x_2, mrpt::vision::CCamModel::CameraTempVariables< T >::x__, mrpt::vision::CCamModel::CameraTempVariables< T >::y_, mrpt::vision::CCamModel::CameraTempVariables< T >::y_2, and mrpt::vision::CCamModel::CameraTempVariables< T >::y__.
void mrpt::vision::CCamModel::jacob_undistor | ( | const mrpt::vision::TPixelCoordf & | p, |
mrpt::math::CMatrixDouble & | J_undist | ||
) |
Calculate the image coordinates undistorted.
void mrpt::vision::CCamModel::jacob_undistor_fm | ( | const mrpt::vision::TPixelCoordf & | uvd, |
math::CMatrixDouble & | J_undist | ||
) |
Jacobian for undistortion the image coordinates.
void mrpt::vision::CCamModel::jacobian_project_with_distortion | ( | const mrpt::math::TPoint3D & | p3D, |
math::CMatrixDouble & | dh_dy | ||
) | const |
Jacobian of the projection of 3D points (with distortion), as done in project_3D_point , evaluated at the point p3D (read below the full explanation)
We define as the projected point in pixels (origin at the top-left corner), and
as the 3D point in space, in coordinates relative to the camera (+Z pointing forwards).
Then this method computes the 2x3 Jacobian:
With:
where is the focal length in units of pixel sizes in x and y, respectively. And, if we define:
then:
void mrpt::vision::CCamModel::jacobian_unproject_with_distortion | ( | const mrpt::vision::TPixelCoordf & | p, |
math::CMatrixDouble & | dy_dh | ||
) | const |
void mrpt::vision::CCamModel::loadFromConfigFile | ( | const mrpt::utils::CConfigFileBase & | source, |
const std::string & | section | ||
) | [virtual] |
This method loads the options from a ".ini"-like file or memory-stored string list.
Implements mrpt::utils::CLoadableOptions.
void mrpt::vision::CCamModel::project_3D_point | ( | const mrpt::math::TPoint3D & | p3D, |
mrpt::vision::TPixelCoordf & | distorted_p | ||
) | const |
Return the (distorted) pixel position of a 3D point given in coordinates relative to the camera (+Z pointing forward, +X to the right)
CMatrixFixedNumeric<double,4,2> mrpt::vision::CCamModel::secondInverseJacobian | ( | ) | const [inline, private] |
Definition at line 229 of file CCamModel.h.
CMatrixFixedNumeric<double,3,4> mrpt::vision::CCamModel::thirdInverseJacobian | ( | ) | const [inline, private] |
Definition at line 237 of file CCamModel.h.
void mrpt::vision::CCamModel::undistort_point | ( | const mrpt::vision::TPixelCoordf & | p, |
mrpt::vision::TPixelCoordf & | undistorted_p | ||
) |
Return the pixel position undistorted by the camera The input values 'col' and 'row' will be replace for the new values (undistorted)
void mrpt::vision::CCamModel::unproject_3D_point | ( | const mrpt::vision::TPixelCoordf & | distorted_p, |
mrpt::math::TPoint3D & | p3D | ||
) | const |
Return the 3D location of a point (at a fixed distance z=1), for the given (distorted) pixel position.
The parameters of a camera.
Definition at line 53 of file CCamModel.h.
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011 |