Main MRPT website > C++ reference
MRPT logo
Functions

mrpt::vision::pinhole Namespace Reference


Detailed Description

Functions related to pinhole camera models, point projections, etc.

Functions

void VISION_IMPEXP projectPoints_no_distortion (const std::vector< mrpt::poses::CPoint3D > &in_points_3D, const mrpt::poses::CPose3D &cameraPose, const mrpt::math::CMatrixDouble33 &intrinsicParams, std::vector< TPixelCoordf > &projectedPoints, bool accept_points_behind=false)
 Project a set of 3D points into a camera at an arbitrary 6D pose using its calibration matrix (undistorted projection model)
template<bool INVERSE_CAM_POSE>
TPixelCoordf projectPoint_no_distortion (const mrpt::utils::TCamera &cam_params, const mrpt::poses::CPose3D &F, const mrpt::math::TPoint3D &P)
 Project a single 3D point with global coordinates P into a camera at pose F, without distortion parameters.
void VISION_IMPEXP projectPoints_with_distortion (const std::vector< mrpt::poses::CPoint3D > &in_points_3D, const mrpt::poses::CPose3D &cameraPose, const mrpt::math::CMatrixDouble33 &intrinsicParams, const std::vector< double > &distortionParams, std::vector< TPixelCoordf > &projectedPoints, bool accept_points_behind=false)
 Project a set of 3D points into a camera at an arbitrary 6D pose using its calibration matrix and distortion parameters (radial and tangential distortions projection model)
void VISION_IMPEXP projectPoint_with_distortion (const mrpt::math::TPoint3D &in_point_wrt_cam, const mrpt::utils::TCamera &in_cam_params, TPixelCoordf &out_projectedPoints, bool accept_points_behind=false)
 Project one 3D point into a camera using its calibration matrix and distortion parameters (radial and tangential distortions projection model)
void VISION_IMPEXP projectPoints_with_distortion (const std::vector< mrpt::math::TPoint3D > &P, const mrpt::utils::TCamera &params, const CPose3DQuat &cameraPose, std::vector< TPixelCoordf > &pixels, bool accept_points_behind=false)
void VISION_IMPEXP undistort_points (const std::vector< TPixelCoordf > &srcDistortedPixels, std::vector< TPixelCoordf > &dstUndistortedPixels, const mrpt::math::CMatrixDouble33 &intrinsicParams, const std::vector< double > &distortionParams)
 Undistort a list of points given by their pixel coordinates, provided the camera matrix and distortion coefficients.
void VISION_IMPEXP undistort_points (const std::vector< TPixelCoordf > &srcDistortedPixels, std::vector< TPixelCoordf > &dstUndistortedPixels, const mrpt::utils::TCamera &cameraModel)
 Undistort a list of points given by their pixel coordinates, provided the camera matrix and distortion coefficients.
void VISION_IMPEXP undistort_point (const TPixelCoordf &inPt, TPixelCoordf &outPt, const mrpt::utils::TCamera &cameraModel)
 Undistort one point given by its pixel coordinates and the camera parameters.

Function Documentation

template<bool INVERSE_CAM_POSE>
TPixelCoordf mrpt::vision::pinhole::projectPoint_no_distortion ( const mrpt::utils::TCamera cam_params,
const mrpt::poses::CPose3D F,
const mrpt::math::TPoint3D P 
) [inline]

Project a single 3D point with global coordinates P into a camera at pose F, without distortion parameters.

The template argument INVERSE_CAM_POSE is related on how the camera pose "F" is stored:

  • INVERSE_CAM_POSE:false -> The local coordinates of the feature wrt the camera F are: $ P \ominus F $
  • INVERSE_CAM_POSE:true -> The local coordinates of the feature wrt the camera F are: $ F \oplus P $

Definition at line 69 of file pinhole.h.

References ASSERT_, mrpt::poses::CPose3D::composePoint(), mrpt::utils::TCamera::cx(), mrpt::utils::TCamera::cy(), mrpt::utils::TCamera::fx(), mrpt::utils::TCamera::fy(), mrpt::poses::CPose3D::inverseComposePoint(), mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, internal::y, and mrpt::math::TPoint3D::z.

void VISION_IMPEXP mrpt::vision::pinhole::projectPoint_with_distortion ( const mrpt::math::TPoint3D in_point_wrt_cam,
const mrpt::utils::TCamera in_cam_params,
TPixelCoordf &  out_projectedPoints,
bool  accept_points_behind = false 
)

Project one 3D point into a camera using its calibration matrix and distortion parameters (radial and tangential distortions projection model)

Parameters:
in_point_wrt_cam[IN] The 3D point wrt the camera focus, with +Z=optical axis, +X=righthand in the image plane, +Y=downward in the image plane.
in_cam_params[IN] The camera parameters. See http://www.mrpt.org/Camera_Parameters
out_projectedPoints[OUT] The projected point, in pixel units.
accept_points_behind[IN] See the note below.
Note:
Points "behind" the camera (which couldn't be physically seen in the real world) are marked with pixel coordinates (-1,-1) to detect them as invalid, unless accept_points_behind is true. In that case they'll be projected normally.
See also:
projectPoints_with_distortion
void VISION_IMPEXP mrpt::vision::pinhole::projectPoints_no_distortion ( const std::vector< mrpt::poses::CPoint3D > &  in_points_3D,
const mrpt::poses::CPose3D cameraPose,
const mrpt::math::CMatrixDouble33 intrinsicParams,
std::vector< TPixelCoordf > &  projectedPoints,
bool  accept_points_behind = false 
)

Project a set of 3D points into a camera at an arbitrary 6D pose using its calibration matrix (undistorted projection model)

Parameters:
in_points_3D[IN] The list of 3D points in world coordinates (meters) to project.
cameraPose[IN] The pose of the camera in the world.
intrinsicParams[IN] The 3x3 calibration matrix. See http://www.mrpt.org/Camera_Parameters
projectedPoints[OUT] The list of image coordinates (in pixels) for the projected points. At output this list is resized to the same number of input points.
accept_points_behind[IN] See the note below.
Note:
Points "behind" the camera (which couldn't be physically seen in the real world) are marked with pixel coordinates (-1,-1) to detect them as invalid, unless accept_points_behind is true. In that case they'll be projected normally.
See also:
projectPoints_with_distortion, projectPoint_no_distortion
void VISION_IMPEXP mrpt::vision::pinhole::projectPoints_with_distortion ( const std::vector< mrpt::math::TPoint3D > &  P,
const mrpt::utils::TCamera params,
const CPose3DQuat &  cameraPose,
std::vector< TPixelCoordf > &  pixels,
bool  accept_points_behind = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void VISION_IMPEXP mrpt::vision::pinhole::projectPoints_with_distortion ( const std::vector< mrpt::poses::CPoint3D > &  in_points_3D,
const mrpt::poses::CPose3D cameraPose,
const mrpt::math::CMatrixDouble33 intrinsicParams,
const std::vector< double > &  distortionParams,
std::vector< TPixelCoordf > &  projectedPoints,
bool  accept_points_behind = false 
)

Project a set of 3D points into a camera at an arbitrary 6D pose using its calibration matrix and distortion parameters (radial and tangential distortions projection model)

Parameters:
in_points_3D[IN] The list of 3D points in world coordinates (meters) to project.
cameraPose[IN] The pose of the camera in the world.
intrinsicParams[IN] The 3x3 calibration matrix. See http://www.mrpt.org/Camera_Parameters
distortionParams[IN] The 4-length vector with the distortion parameters [k1 k2 p1 p2]. See http://www.mrpt.org/Camera_Parameters
projectedPoints[OUT] The list of image coordinates (in pixels) for the projected points. At output this list is resized to the same number of input points.
accept_points_behind[IN] See the note below.
Note:
Points "behind" the camera (which couldn't be physically seen in the real world) are marked with pixel coordinates (-1,-1) to detect them as invalid, unless accept_points_behind is true. In that case they'll be projected normally.
See also:
projectPoint_with_distortion, projectPoints_no_distortion
void VISION_IMPEXP mrpt::vision::pinhole::undistort_point ( const TPixelCoordf &  inPt,
TPixelCoordf &  outPt,
const mrpt::utils::TCamera cameraModel 
)

Undistort one point given by its pixel coordinates and the camera parameters.

See also:
undistort_points
void VISION_IMPEXP mrpt::vision::pinhole::undistort_points ( const std::vector< TPixelCoordf > &  srcDistortedPixels,
std::vector< TPixelCoordf > &  dstUndistortedPixels,
const mrpt::utils::TCamera cameraModel 
)

Undistort a list of points given by their pixel coordinates, provided the camera matrix and distortion coefficients.

Parameters:
srcDistortedPixels[IN] The pixel coordinates as in the distorted image.
dstUndistortedPixels[OUT] The computed pixel coordinates without distortion.
cameraModel[IN] The camera parameters.
See also:
undistort_point
void VISION_IMPEXP mrpt::vision::pinhole::undistort_points ( const std::vector< TPixelCoordf > &  srcDistortedPixels,
std::vector< TPixelCoordf > &  dstUndistortedPixels,
const mrpt::math::CMatrixDouble33 intrinsicParams,
const std::vector< double > &  distortionParams 
)

Undistort a list of points given by their pixel coordinates, provided the camera matrix and distortion coefficients.

Parameters:
srcDistortedPixels[IN] The pixel coordinates as in the distorted image.
dstUndistortedPixels[OUT] The computed pixel coordinates without distortion.
intrinsicParams[IN] The 3x3 calibration matrix. See http://www.mrpt.org/Camera_Parameters
distortionParams[IN] The 4-length vector with the distortion parameters [k1 k2 p1 p2]. See http://www.mrpt.org/Camera_Parameters
See also:
undistort_point



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011