40 #ifndef vpMeterPixelConversion_H 41 #define vpMeterPixelConversion_H 49 #include <visp3/core/vpCameraParameters.h> 50 #include <visp3/core/vpCircle.h> 51 #include <visp3/core/vpSphere.h> 52 #include <visp3/core/vpException.h> 53 #include <visp3/core/vpImagePoint.h> 54 #include <visp3/core/vpMath.h> 56 #if VISP_HAVE_OPENCV_VERSION >= 0x020300 57 # include <opencv2/calib3d/calib3d.hpp> 78 double &mu20_p,
double &mu11_p,
double &mu02_p);
80 double &mu20_p,
double &mu11_p,
double &mu02_p);
81 static void convertLine(
const vpCameraParameters &cam,
const double &rho_m,
const double &theta_m,
double &rho_p,
108 const double &x,
const double &y,
double &u,
double &v)
110 switch (cam.projModel) {
112 convertPointWithoutDistortion(cam, x, y, u, v);
115 convertPointWithDistortion(cam, x, y, u, v);
146 switch (cam.projModel) {
148 convertPointWithoutDistortion(cam, x, y, iP);
151 convertPointWithDistortion(cam, x, y, iP);
156 #ifndef DOXYGEN_SHOULD_SKIP_THIS 166 inline static void convertPointWithoutDistortion(
const vpCameraParameters &cam,
const double &x,
const double &y,
167 double &u,
double &v)
169 u = x * cam.px + cam.u0;
170 v = y * cam.py + cam.v0;
183 inline static void convertPointWithoutDistortion(
const vpCameraParameters &cam,
const double &x,
const double &y,
186 iP.
set_u(x * cam.px + cam.u0);
187 iP.
set_v(y * cam.py + cam.v0);
206 inline static void convertPointWithDistortion(
const vpCameraParameters &cam,
const double &x,
const double &y,
207 double &u,
double &v)
209 double r2 = 1. + cam.kud * (x * x + y * y);
210 u = cam.u0 + cam.px * x * r2;
211 v = cam.v0 + cam.py * y * r2;
230 inline static void convertPointWithDistortion(
const vpCameraParameters &cam,
const double &x,
const double &y,
233 double r2 = 1. + cam.kud * (x * x + y * y);
234 iP.
set_u(cam.u0 + cam.px * x * r2);
235 iP.
set_v(cam.v0 + cam.py * y * r2);
237 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS 240 #if VISP_HAVE_OPENCV_VERSION >= 0x020300 243 static void convertEllipse(
const cv::Mat &cameraMatrix,
245 double &mu20_p,
double &mu11_p,
double &mu02_p);
246 static void convertEllipse(
const cv::Mat &cameraMatrix,
248 double &mu20_p,
double &mu11_p,
double &mu02_p);
249 static void convertLine(
const cv::Mat &cameraMatrix,
250 const double &rho_m,
const double &theta_m,
251 double &rho_p,
double &theta_p);
252 static void convertPoint(
const cv::Mat &cameraMatrix,
const cv::Mat &distCoeffs,
253 const double &x,
const double &y,
double &u,
double &v);
254 static void convertPoint(
const cv::Mat &cameraMatrix,
const cv::Mat &distCoeffs,
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, vpImagePoint &iP)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Class that defines what is a sphere.
void set_u(const double u)
void set_v(const double v)
Generic class defining intrinsic camera parameters.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Class that defines what is a circle.