Function mrpt::img::camera_geometry::projectPoints

Function Documentation

void mrpt::img::camera_geometry::projectPoints(const std::vector<mrpt::math::TPoint3D> &points3D, const mrpt::math::TPose3D &cameraPose, const mrpt::math::CMatrixDouble33 &intrinsicParams, std::vector<mrpt::img::TPixelCoordf> &projectedPoints, bool acceptPointsBehind = false)

Project 3D points to image plane without distortion (pinhole model only).

This applies only the intrinsic camera matrix transformation:

\[ u = f_x \frac{X}{Z} + c_x, \quad v = f_y \frac{Y}{Z} + c_y \]

Note

Points behind the camera (Z≤0 in camera frame) are marked with pixel coordinates (-1,-1) unless acceptPointsBehind=true.

Parameters:
  • points3D – [IN] 3D points in world coordinates (meters)

  • cameraPose – [IN] Camera pose in world coordinates

  • intrinsicParams – [IN] 3x3 camera calibration matrix K

  • projectedPoints – [OUT] Projected pixel coordinates (resized automatically)

  • acceptPointsBehind – [IN] If false, points with Z≤0 are marked as (-1,-1)