10 #ifndef mrpt_vision_pinhole_H 11 #define mrpt_vision_pinhole_H 48 const std::vector<mrpt::math::TPoint3D>& in_points_3D,
51 std::vector<mrpt::img::TPixelCoordf>& projectedPoints,
52 bool accept_points_behind =
false);
63 template <
bool INVERSE_CAM_POSE>
76 cam_params.
cx() + cam_params.
fx() *
x /
z,
77 cam_params.
cy() + cam_params.
fy() *
y /
z);
81 template <
typename POINT>
86 ASSERT_(in_point_wrt_cam.z != 0);
88 out_projectedPoints.
x =
90 cam_params.
fx() * in_point_wrt_cam.x / in_point_wrt_cam.z;
91 out_projectedPoints.
y =
93 cam_params.
fy() * in_point_wrt_cam.y / in_point_wrt_cam.z;
119 const std::vector<mrpt::math::TPoint3D>& in_points_3D,
122 const std::vector<double>& distortionParams,
123 std::vector<mrpt::img::TPixelCoordf>& projectedPoints,
124 bool accept_points_behind =
false);
147 bool accept_points_behind =
false);
151 const std::vector<mrpt::math::TPoint3D>& P,
154 std::vector<mrpt::img::TPixelCoordf>&
pixels,
155 bool accept_points_behind =
false);
170 const std::vector<mrpt::img::TPixelCoordf>& srcDistortedPixels,
171 std::vector<mrpt::img::TPixelCoordf>& dstUndistortedPixels,
173 const std::vector<double>& distortionParams);
185 const std::vector<mrpt::img::TPixelCoordf>& srcDistortedPixels,
186 std::vector<mrpt::img::TPixelCoordf>& dstUndistortedPixels,
void projectPoint_with_distortion(const mrpt::math::TPoint3D &in_point_wrt_cam, const mrpt::img::TCamera &in_cam_params, mrpt::img::TPixelCoordf &out_projectedPoints, bool accept_points_behind=false)
Project one 3D point into a camera using its calibration matrix and distortion parameters (radial and...
double fx() const
Get the value of the focal length x-value (in pixels).
double fy() const
Get the value of the focal length y-value (in pixels).
A pair (x,y) of pixel coordinates (subpixel resolution).
#define ASSERT_(f)
Defines an assertion mechanism.
double cy() const
Get the value of the principal point y-coordinate (in pixels).
Structure to hold the parameters of a pinhole camera model.
double x
X,Y,Z coordinates.
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
void projectPoints_with_distortion(const std::vector< mrpt::math::TPoint3D > &in_points_3D, const mrpt::poses::CPose3D &cameraPose, const mrpt::math::CMatrixDouble33 &intrinsicParams, const std::vector< double > &distortionParams, std::vector< mrpt::img::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 dis...
void undistort_point(const mrpt::img::TPixelCoordf &inPt, mrpt::img::TPixelCoordf &outPt, const mrpt::img::TCamera &cameraModel)
Undistort one point given by its pixel coordinates and the camera parameters.
double cx() const
Get the value of the principal point x-coordinate (in pixels).
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void undistort_points(const std::vector< mrpt::img::TPixelCoordf > &srcDistortedPixels, std::vector< mrpt::img::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 distortio...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
mrpt::img::TPixelCoordf projectPoint_no_distortion(const mrpt::img::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 param...
void composePoint(double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dse3=nullptr, bool use_small_rot_approx=false) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
void projectPoints_no_distortion(const std::vector< mrpt::math::TPoint3D > &in_points_3D, const mrpt::poses::CPose3D &cameraPose, const mrpt::math::CMatrixDouble33 &intrinsicParams, std::vector< mrpt::img::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 (undist...
GLenum const GLfloat * params
void inverseComposePoint(const double gx, const double gy, const double gz, double &lx, double &ly, double &lz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dse3=nullptr) const
Computes the 3D point L such as .