#include <mrpt/vision/CCamModel.h>
Public Member Functions | |
CCamModel () | |
Defalult 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 init file. | |
unsigned int | cam_nrows () const |
Return the rows number for a image captured by the camera. | |
unsigned int | cam_ncols () const |
Return the columns number for a image captured by the camera. | |
double | cam_cx () const |
Return the 'x' position of the optic center over the image. | |
double | cam_cy () const |
Return the 'y' position of the optic center over the image. | |
double | cam_k1 () const |
Return the first parameter of radial distortion. | |
double | cam_k2 () const |
Return the second parameter of radial distortion. | |
double | cam_fx () const |
Return the focal distance of the camera, in 'x' PIXELS (Element (1,1) in the camera matrix). | |
double | cam_fy () const |
Return the focal distance of the camera, in 'y' PIXELS (Element (2,2) in the camera matrix). | |
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 |
Protected Attributes | |
vision::TCamera | cam |
For now, the only model is the pinhole model.
Definition at line 71 of file CCamModel.h.
mrpt::vision::CCamModel::CCamModel | ( | ) |
Defalult Constructor.
mrpt::vision::CCamModel::CCamModel | ( | const mrpt::utils::CConfigFileBase & | cfgIni | ) |
Constructor from a init file.
double mrpt::vision::CCamModel::cam_cx | ( | ) | const [inline] |
Return the 'x' position of the optic center over the image.
Definition at line 105 of file CCamModel.h.
double mrpt::vision::CCamModel::cam_cy | ( | ) | const [inline] |
Return the 'y' position of the optic center over the image.
Definition at line 109 of file CCamModel.h.
double mrpt::vision::CCamModel::cam_fx | ( | ) | const [inline] |
Return the focal distance of the camera, in 'x' PIXELS (Element (1,1) in the camera matrix).
Definition at line 121 of file CCamModel.h.
double mrpt::vision::CCamModel::cam_fy | ( | ) | const [inline] |
Return the focal distance of the camera, in 'y' PIXELS (Element (2,2) in the camera matrix).
Definition at line 125 of file CCamModel.h.
double mrpt::vision::CCamModel::cam_k1 | ( | ) | const [inline] |
double mrpt::vision::CCamModel::cam_k2 | ( | ) | const [inline] |
unsigned int mrpt::vision::CCamModel::cam_ncols | ( | ) | const [inline] |
Return the columns number for a image captured by the camera.
Definition at line 101 of file CCamModel.h.
unsigned int mrpt::vision::CCamModel::cam_nrows | ( | ) | const [inline] |
Return the rows number for a image captured by the camera.
Definition at line 97 of file CCamModel.h.
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.
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).
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.
vision::TCamera mrpt::vision::CCamModel::cam [protected] |
Definition at line 74 of file CCamModel.h.
Page generated by Doxygen 1.5.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:32:05 EDT 2009 |