![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpPixelMeterConversion.h>
Static Public Member Functions | |
Using ViSP camera parameters | |
| static void | convertEllipse (const vpCameraParameters &cam, const vpImagePoint ¢er_p, double n20_p, double n11_p, double n02_p, double &xc_m, double &yc_m, double &n20_m, double &n11_m, double &n02_m) |
| static void | convertLine (const vpCameraParameters &cam, const double &rho_p, const double &theta_p, double &rho_m, double &theta_m) |
| static void | convertMoment (const vpCameraParameters &cam, unsigned int order, const vpMatrix &moment_pixel, vpMatrix &moment_meter) |
| static void | convertPoint (const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y) |
| static void | convertPoint (const vpCameraParameters &cam, const vpImagePoint &iP, double &x, double &y) |
Using OpenCV camera parameters | |
| static void | convertEllipse (const cv::Mat &cameraMatrix, const cv::Mat &distCoeffs, const vpImagePoint ¢er_p, double n20_p, double n11_p, double n02_p, double &xc_m, double &yc_m, double &n20_m, double &n11_m, double &n02_m) |
| static void | convertLine (const cv::Mat &cameraMatrix, const double &rho_p, const double &theta_p, double &rho_m, double &theta_m) |
| static void | convertMoment (const cv::Mat &cameraMatrix, unsigned int order, const vpMatrix &moment_pixel, vpMatrix &moment_meter) |
| static void | convertPoint (const cv::Mat &cameraMatrix, const cv::Mat &distCoeffs, const double &u, const double &v, double &x, double &y) |
| static void | convertPoint (const cv::Mat &cameraMatrix, const cv::Mat &distCoeffs, const vpImagePoint &iP, double &x, double &y) |
Various conversion functions to transform primitives (2D line, moments, 2D point) from pixel to normalized coordinates in meter in the image plane.
Transformation relies either on ViSP camera parameters implemented in vpCameraParameters or on OpenCV camera parameters that are set from a projection matrix and a distortion coefficients vector.
Tutorials
To see how to use this class, you may have a look at:
Definition at line 71 of file vpPixelMeterConversion.h.
|
static |
Convert ellipse parameters (ie ellipse center and normalized centered moments) from pixels
to meters
in the image plane.
| [in] | cameraMatrix | : Camera Matrix |
| [in] | distCoeffs | : Input vector of distortion coefficients |
| [in] | center_p | : Center of the ellipse (uc, vc) with pixel coordinates. |
| [in] | n20_p | : Normalized second order moments of the ellipse in pixels. |
| [in] | n11_p | : Normalized second order moments of the ellipse in pixels. |
| [in] | n02_p | : Normalized second order moments of the ellipse in pixels. |
| [out] | xc_m | : Center of the ellipse along x-axis with coordinates in meters in the image plane. |
| [out] | yc_m | : Center of the ellipse along y-axis with coordinates in meters in the image plane. |
| [out] | n20_m | : Normalized second order moments of the ellipse in meters in the image plane. |
| [out] | n11_m | : Normalized second order moments of the ellipse in meters in the image plane. |
| [out] | n02_m | : Normalized second order moments of the ellipse in meters in the image plane. |
Definition at line 213 of file vpPixelMeterConversion.cpp.
References convertPoint().
|
static |
Convert ellipse parameters (ie ellipse center and normalized centered moments) from pixels
to meters
in the image plane.
| [in] | cam | : Camera parameters. |
| [in] | center_p | : Center of the ellipse (uc, vc) with pixel coordinates. |
| [in] | n20_p | : Normalized second order moments of the ellipse in pixels. |
| [in] | n11_p | : Normalized second order moments of the ellipse in pixels. |
| [in] | n02_p | : Normalized second order moments of the ellipse in pixels. |
| [out] | xc_m | : Center of the ellipse along x-axis with coordinates in meters in the image plane. |
| [out] | yc_m | : Center of the ellipse along y-axis with coordinates in meters in the image plane. |
| [out] | n20_m | : Normalized second order moments of the ellipse in meters in the image plane. |
| [out] | n11_m | : Normalized second order moments of the ellipse in meters in the image plane. |
| [out] | n02_m | : Normalized second order moments of the ellipse in meters in the image plane. |
Definition at line 74 of file vpPixelMeterConversion.cpp.
References convertPoint().
Referenced by vpFeatureBuilder::create().
|
static |
Line parameters conversion from pixel
to normalized coordinates
in meter using OpenCV camera parameters. This function doesn't use distortion coefficients.
| [in] | cameraMatrix | : Camera Matrix |
| [in] | rho_p | : Line |
| [in] | theta_p | : Line |
| [out] | rho_m | : Line |
| [out] | theta_m | : Line |
Definition at line 237 of file vpPixelMeterConversion.cpp.
References vpException::divideByZeroError, and vpMath::sqr().
|
static |
Line parameters conversion from pixel
to normalized coordinates
in meter using ViSP camera parameters. This function doesn't use distortion coefficients.
| [in] | cam | : camera parameters. |
| [in] | rho_p | : Line |
| [in] | theta_p | : Line |
| [out] | rho_m | : Line |
| [out] | theta_m | : Line |
Definition at line 98 of file vpPixelMeterConversion.cpp.
References vpException::divideByZeroError, and vpMath::sqr().
Referenced by vpFeatureBuilder::create().
|
static |
Moments conversion from pixel to normalized coordinates in meter using OpenCV camera parameters. This function doesn't use distortion coefficients.
| [in] | cameraMatrix | : Camera Matrix |
| [in] | order | : Moment order. |
| [in] | moment_pixel | : Moment values in pixels. |
| [out] | moment_meter | : Moment values in meters in the image plane. |
Definition at line 266 of file vpPixelMeterConversion.cpp.
References vpMath::comb().
|
static |
Moments conversion from pixel to normalized coordinates in meter using ViSP camera parameters. This function doesn't use distortion coefficients.
| [in] | cam | : camera parameters. |
| [in] | order | : Moment order. |
| [in] | moment_pixel | : Moment values in pixels. |
| [out] | moment_meter | : Moment values in meters in the image plane. |
The following example show how to use this function.
Definition at line 149 of file vpPixelMeterConversion.cpp.
References vpMath::comb().
|
static |
Point coordinates conversion from pixel coordinates
to normalized coordinates
in meter using OpenCV camera parameters.
| [in] | cameraMatrix | : Camera Matrix |
| [in] | distCoeffs | : Input vector of distortion coefficients |
| [in] | u | : input coordinate in pixels along image horizontal axis. |
| [in] | v | : input coordinate in pixels along image vertical axis. |
| [out] | x | : output coordinate in meter along image plane x-axis. |
| [out] | y | : output coordinate in meter along image plane y-axis. |
Definition at line 329 of file vpPixelMeterConversion.cpp.
|
static |
Point coordinates conversion from pixel coordinates
to normalized coordinates
in meter using OpenCV camera parameters.
| [in] | cameraMatrix | : Camera Matrix |
| [in] | distCoeffs | : Input vector of distortion coefficients |
| [in] | iP | : input coordinates in pixels. |
| [out] | x | : output coordinate in meter along image plane x-axis. |
| [out] | y | : output coordinate in meter along image plane y-axis. |
Definition at line 353 of file vpPixelMeterConversion.cpp.
References vpImagePoint::get_u(), and vpImagePoint::get_v().
|
inlinestatic |
Point coordinates conversion from pixel coordinates
to normalized coordinates
in meter using ViSP camera parameters.
The used formula depends on the projection model of the camera. To know the currently used projection model use vpCameraParameter::get_projModel()
| [in] | cam | : camera parameters. |
| [in] | u | : input coordinate in pixels along image horizontal axis. |
| [in] | v | : input coordinate in pixels along image vertical axis. |
| [out] | x | : output coordinate in meter along image plane x-axis. |
| [out] | y | : output coordinate in meter along image plane y-axis. |
and
in the case of perspective projection without distortion.
and
with
in the case of perspective projection with distortion.
In the case of a projection with Kannala-Brandt distortion, refer to [23].
Definition at line 108 of file vpPixelMeterConversion.h.
References vpException::fatalError, vpCameraParameters::perspectiveProjWithDistortion, vpCameraParameters::perspectiveProjWithoutDistortion, and vpCameraParameters::ProjWithKannalaBrandtDistortion.
Referenced by vpFeatureLuminance::buildFrom(), vpKeyPoint::compute3D(), vpKeyPoint::compute3D(), vpKeyPoint::compute3DForPointsOnCylinders(), vpKeyPoint::compute3DForPointsOnCylinders(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtFaceDepthNormal::computeDesiredFeatures(), vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(), vpMbtDistanceKltPoints::computeInteractionMatrixAndResidu(), vpMbtDistanceCircle::computeInteractionMatrixError(), vpPose::computePlanarObjectPoseFromRGBD(), vpPose::computePlanarObjectPoseFromRGBD(), vpPose::computePlanarObjectPoseWithAtLeast3Points(), convertEllipse(), convertEllipse(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpImageConvert::depthToPointCloud(), vpImageConvert::depthToPointCloud(), vpPlaneEstimation::estimatePlane(), vpPlaneEstimation::estimatePlane(), vpMomentObject::fromImage(), vpMomentObject::fromImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpImageSimulator::getImage(), vpSilhouettePointsExtractionSettings::getSilhouetteCandidates(), vpMbtDistanceKltCylinder::init(), vpMbTracker::initClick(), vpMbTracker::initFromPoints(), vpMbTracker::initFromPoints(), vpKeyPoint::matchPoint(), vpRBProbabilistic3DDriftDetector::update(), and vpKinect::warpRGBFrame().
|
inlinestatic |
Point coordinates conversion from pixel coordinates Coordinates in pixel to normalized coordinates
in meter using ViSP camera parameters.
The used formula depends on the projection model of the camera. To know the currently used projection model use vpCameraParameter::get_projModel()
| [in] | cam | : camera parameters. |
| [in] | iP | : input coordinates in pixels. |
| [out] | x | : output coordinate in meter along image plane x-axis. |
| [out] | y | : output coordinate in meter along image plane y-axis. |
Thanks to the pixel coordinates in the frame (u,v), the meter coordinates are given by :
and
in the case of perspective projection without distortion.
and
with
in the case of perspective projection with distortion.
In the case of a projection with Kannala-Brandt distortion, refer to [23].
Definition at line 153 of file vpPixelMeterConversion.h.
References vpException::fatalError, vpCameraParameters::perspectiveProjWithDistortion, vpCameraParameters::perspectiveProjWithoutDistortion, and vpCameraParameters::ProjWithKannalaBrandtDistortion.