40 #ifndef vpPixelMeterConversion_H
41 #define vpPixelMeterConversion_H
48 #include <visp3/core/vpCameraParameters.h>
49 #include <visp3/core/vpDebug.h>
50 #include <visp3/core/vpException.h>
51 #include <visp3/core/vpImagePoint.h>
52 #include <visp3/core/vpMath.h>
54 #if VISP_HAVE_OPENCV_VERSION >= 0x020300
55 # include <opencv2/imgproc/imgproc.hpp>
56 # include <opencv2/calib3d/calib3d.hpp>
76 static void convertLine(
const vpCameraParameters &cam,
const double &rho_p,
const double &theta_p,
double &rho_m,
104 const double &u,
const double &v,
double &x,
double &y)
106 switch (cam.projModel) {
108 convertPointWithoutDistortion(cam, u, v, x, y);
111 convertPointWithDistortion(cam, u, v, x, y);
143 switch (cam.projModel) {
145 convertPointWithoutDistortion(cam, iP, x, y);
148 convertPointWithDistortion(cam, iP, x, y);
153 #ifndef DOXYGEN_SHOULD_SKIP_THIS
167 const double &u,
const double &v,
double &x,
double &y)
169 x = (u - cam.u0) * cam.inv_px;
170 y = (v - cam.v0) * cam.inv_py;
191 x = (iP.
get_u() - cam.u0) * cam.inv_px;
192 y = (iP.
get_v() - cam.v0) * cam.inv_py;
210 const double &u,
const double &v,
double &x,
double &y)
212 double r2 = 1. + cam.kdu * (
vpMath::sqr((u - cam.u0) * cam.inv_px) +
vpMath::sqr((v - cam.v0) * cam.inv_py));
213 x = (u - cam.u0) * r2 * cam.inv_px;
214 y = (v - cam.v0) * r2 * cam.inv_py;
236 double r2 = 1. + cam.kdu * (
vpMath::sqr((iP.
get_u() - cam.u0) * cam.inv_px) +
238 x = (iP.
get_u() - cam.u0) * r2 * cam.inv_px;
239 y = (iP.
get_v() - cam.v0) * r2 * cam.inv_py;
241 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
244 #if VISP_HAVE_OPENCV_VERSION >= 0x020300
247 static void convertLine(
const cv::Mat &cameraMatrix,
248 const double &rho_p,
const double &theta_p,
249 double &rho_m,
double &theta_m);
250 static void convertMoment(
const cv::Mat &cameraMatrix,
251 unsigned int order,
const vpMatrix &moment_pixel,
253 static void convertPoint(
const cv::Mat &cameraMatrix,
const cv::Mat &distCoeffs,
254 const double &u,
const double &v,
double &x,
double &y);
255 static void convertPoint(
const cv::Mat &cameraMatrix,
const cv::Mat &distCoeffs,