72 double &n20_p,
double &n11_p,
double &n02_p);
74 double &n20_p,
double &n11_p,
double &n02_p);
76 double n02_m,
vpImagePoint ¢er_p,
double &n20_p,
double &n11_p,
double &n02_p);
107 switch (cam.m_projModel) {
109 convertPointWithoutDistortion(cam, x, y, u, v);
112 convertPointWithDistortion(cam, x, y, u, v);
115 convertPointWithKannalaBrandtDistortion(cam, x, y, u, v);
152 switch (cam.m_projModel) {
154 convertPointWithoutDistortion(cam, x, y, iP);
157 convertPointWithDistortion(cam, x, y, iP);
160 convertPointWithKannalaBrandtDistortion(cam, x, y, iP);
168#ifndef DOXYGEN_SHOULD_SKIP_THIS
178 inline static void convertPointWithoutDistortion(
const vpCameraParameters &cam,
const double &x,
const double &y,
179 double &u,
double &v)
181 u = (x * cam.m_px) + cam.m_u0;
182 v = (y * cam.m_py) + cam.m_v0;
195 inline static void convertPointWithoutDistortion(
const vpCameraParameters &cam,
const double &x,
const double &y,
218 inline static void convertPointWithDistortion(
const vpCameraParameters &cam,
const double &x,
const double &y,
219 double &u,
double &v)
221 double r2 = 1. + (
cam.m_kud * ((
x *
x) + (
y *
y)));
242 inline static void convertPointWithDistortion(
const vpCameraParameters &cam,
const double &x,
const double &y,
245 double r2 = 1. + (
cam.m_kud * ((
x *
x) + (
y *
y)));
272 inline static void convertPointWithKannalaBrandtDistortion(
const vpCameraParameters &cam,
const double &x,
273 const double &y,
double &u,
double &v)
276 double theta = atan(r);
277 const unsigned int index_0 = 0;
278 const unsigned int index_1 = 1;
279 const unsigned int index_2 = 2;
280 const unsigned int index_3 = 3;
282 std::vector<double> k =
cam.getKannalaBrandtDistortionCoefficients();
284 double theta2 = theta * theta, theta3 = theta2 * theta, theta4 = theta2 * theta2, theta5 = theta4 * theta,
285 theta6 = theta3 * theta3, theta7 = theta6 * theta, theta8 = theta4 * theta4, theta9 = theta8 * theta;
287 double r_d = theta + (k[index_0] * theta3) + (k[index_1] * theta5) + (k[index_2] * theta7) + (k[index_3] * theta9);
289 double scale = (std::fabs(r) < std::numeric_limits<double>::epsilon()) ? 1.0 : (r_d /
r);
291 double x_d =
x * scale;
292 double y_d =
y * scale;
294 u = (
cam.m_px * x_d) +
cam.m_u0;
295 v = (
cam.m_py * y_d) +
cam.m_v0;
319 inline static void convertPointWithKannalaBrandtDistortion(
const vpCameraParameters &cam,
const double &x,
320 const double &y, vpImagePoint &iP)
323 double theta = atan(r);
324 const unsigned int index_0 = 0;
325 const unsigned int index_1 = 1;
326 const unsigned int index_2 = 2;
327 const unsigned int index_3 = 3;
329 std::vector<double> k =
cam.getKannalaBrandtDistortionCoefficients();
331 double theta2 = theta * theta, theta3 = theta2 * theta, theta4 = theta2 * theta2, theta5 = theta4 * theta,
332 theta6 = theta3 * theta3, theta7 = theta6 * theta, theta8 = theta4 * theta4, theta9 = theta8 * theta;
334 double r_d = theta + (k[index_0] * theta3) + (k[index_1] * theta5) + (k[index_2] * theta7) + (k[index_3] * theta9);
336 double scale = (std::fabs(r) < std::numeric_limits<double>::epsilon()) ? 1.0 : (r_d /
r);
338 double x_d =
x * scale;
339 double y_d =
y * scale;
348#if defined(VISP_HAVE_OPENCV) && \
349 (((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D)) || \
350 ((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_CALIB) && defined(HAVE_OPENCV_3D)))
353 static void convertEllipse(const cv::Mat &cameraMatrix, const vpCircle &circle, vpImagePoint ¢er, double &n20_p,
354 double &n11_p,
double &n02_p);
355 static void convertEllipse(
const cv::Mat &cameraMatrix,
const vpSphere &sphere, vpImagePoint ¢er,
double &n20_p,
356 double &n11_p,
double &n02_p);
357 static void convertEllipse(
const cv::Mat &cameraMatrix,
double xc_m,
double yc_m,
double n20_m,
double n11_m,
358 double n02_m, vpImagePoint ¢er_p,
double &n20_p,
double &n11_p,
double &n02_p);
359 static void convertLine(
const cv::Mat &cameraMatrix,
const double &rho_m,
const double &theta_m,
double &rho_p,
361 static void convertPoint(
const cv::Mat &cameraMatrix,
const cv::Mat &distCoeffs,
const double &x,
const double &y,
362 double &u,
double &v);
363 static void convertPoint(
const cv::Mat &cameraMatrix,
const cv::Mat &distCoeffs,
const double &x,
const double &y,