Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpPixelMeterConversion Class Reference

#include <visp3/core/vpPixelMeterConversion.h>

Static Public Member Functions

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)
 
static void convertPointWithoutDistortion (const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
 
static void convertPointWithoutDistortion (const vpCameraParameters &cam, const vpImagePoint &iP, double &x, double &y)
 
static void convertPointWithDistortion (const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
 
static void convertPointWithDistortion (const vpCameraParameters &cam, const vpImagePoint &iP, double &x, double &y)
 
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)
 

Detailed Description

Conversion from pixel coordinates $(u,v)$ to normalized coordinates $(x,y)$ in meter.

This class relates to vpCameraParameters.

Definition at line 65 of file vpPixelMeterConversion.h.

Member Function Documentation

void vpPixelMeterConversion::convertLine ( const vpCameraParameters cam,
const double &  rho_p,
const double &  theta_p,
double &  rho_m,
double &  theta_m 
)
static

line coordinates conversion (rho,theta)

Definition at line 52 of file vpPixelMeterConversion.cpp.

References vpException::divideByZeroError, vpMath::sqr(), and vpERROR_TRACE.

Referenced by vpFeatureBuilder::create().

void vpPixelMeterConversion::convertMoment ( const vpCameraParameters cam,
unsigned int  order,
const vpMatrix moment_pixel,
vpMatrix moment_meter 
)
static

Definition at line 72 of file vpPixelMeterConversion.cpp.

References vpMath::comb().

Referenced by vpFeatureBuilder::create().

static void vpPixelMeterConversion::convertPoint ( const vpCameraParameters cam,
const double &  u,
const double &  v,
double &  x,
double &  y 
)
inlinestatic

Point coordinates conversion from pixel coordinates $(u,v)$ to normalized coordinates $(x,y)$ in meter.

The used formula depends on the projection model of the camera. To know the currently used projection model use vpCameraParameter::get_projModel()

Parameters
cam: camera parameters.
u: input coordinate in pixels along image horizontal axis.
v: input coordinate in pixels along image vertical axis.
x: output coordinate in meter along image plane x-axis.
y: output coordinate in meter along image plane y-axis.

$ x = (u-u_0)/p_x $ and $ y = (v-v_0)/p_y $ in the case of perspective projection without distortion.

$ x = (u-u_0)*(1+k_{du}*r^2)/p_x $ and $ y = (v-v_0)*(1+k_{du}*r^2)/p_y $ with $ r^2=((u - u_0)/p_x)^2+((v-v_0)/p_y)^2 $ in the case of perspective projection with distortion.

Examples:
AROgre.cpp, AROgreBasic.cpp, poseVirtualVS.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850FourPointsKinect.cpp, testKeyPoint-4.cpp, testRobotAfma6Pose.cpp, testRobotViper850Pose.cpp, tutorial-matching-keypoint-homography.cpp, tutorial-matching-surf-homography-deprecated.cpp, tutorial-pose-from-points-image.cpp, tutorial-pose-from-points-tracking.cpp, and tutorial-pose-from-qrcode-image.cpp.

Definition at line 92 of file vpPixelMeterConversion.h.

References vpCameraParameters::perspectiveProjWithDistortion, and vpCameraParameters::perspectiveProjWithoutDistortion.

Referenced by vpFeatureLuminance::buildFrom(), vpKeyPoint::compute3D(), vpKeyPoint::compute3DForPointsOnCylinders(), vpMbtDistanceKltPoints::computeInteractionMatrixAndResidu(), vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(), vpMbtDistanceCircle::computeInteractionMatrixError(), vpFeatureBuilder::create(), vpMomentObject::fromImage(), vpImageSimulator::getImage(), vpMbtDistanceKltCylinder::init(), vpMbTracker::initClick(), vpMbTracker::initFromPoints(), vpKeyPoint::matchPoint(), and vpKinect::warpRGBFrame().

static void vpPixelMeterConversion::convertPoint ( const vpCameraParameters cam,
const vpImagePoint iP,
double &  x,
double &  y 
)
inlinestatic

Point coordinates conversion from pixel coordinates Coordinates in pixel to normalized coordinates $(x,y)$ in meter.

The used formula depends on the projection model of the camera. To know the currently used projection model use vpCameraParameter::get_projModel()

Parameters
cam: camera parameters.
iP: input coordinates in pixels.
x: output coordinate in meter along image plane x-axis.
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 :

$ x = (u-u_0)/p_x $ and $ y = (v-v_0)/p_y $ in the case of perspective projection without distortion.

$ x = (u-u_0)*(1+k_{du}*r^2)/p_x $ and $ y = (v-v_0)*(1+k_{du}*r^2)/p_y $ with $ r^2=((u - u_0)/p_x)^2+((v-v_0)/p_y)^2 $ in the case of perspective projection with distortion.

Definition at line 130 of file vpPixelMeterConversion.h.

References vpCameraParameters::perspectiveProjWithDistortion, and vpCameraParameters::perspectiveProjWithoutDistortion.

static void vpPixelMeterConversion::convertPointWithDistortion ( const vpCameraParameters cam,
const double &  u,
const double &  v,
double &  x,
double &  y 
)
inlinestatic

Point coordinates conversion with distortion from pixel coordinates $(u,v)$ to normalized coordinates $(x,y)$ in meter.

Parameters
cam: camera parameters.
u: input coordinate in pixels along image horizontal axis.
v: input coordinate in pixels along image vertical axis.
x: output coordinate in meter along image plane x-axis.
y: output coordinate in meter along image plane y-axis.

$ x = (u-u_0)*(1+k_{du}*r^2)/p_x $ and $ y = (v-v_0)*(1+k_{du}*r^2)/p_y $ with $ r^2=((u - u_0)/p_x)^2 + ((v-v_0)/p_y)^2 $

Definition at line 204 of file vpPixelMeterConversion.h.

References vpMath::sqr().

static void vpPixelMeterConversion::convertPointWithDistortion ( const vpCameraParameters cam,
const vpImagePoint iP,
double &  x,
double &  y 
)
inlinestatic

Point coordinates conversion with distortion from pixel coordinates Coordinates in pixel to normalized coordinates $(x,y)$ in meter.

Parameters
cam: camera parameters.
iP: input coordinates in pixels.
x: output coordinate in meter along image plane x-axis.
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 :

$ x = (u-u_0)*(1+k_{du}*r^2)/p_x $ and $ y = (v-v_0)*(1+k_{du}*r^2)/p_y $ with $ r^2=((u - u_0)/p_x)^2 + ((v-v_0)/p_y)^2 $

Definition at line 231 of file vpPixelMeterConversion.h.

References vpImagePoint::get_u(), vpImagePoint::get_v(), and vpMath::sqr().

static void vpPixelMeterConversion::convertPointWithoutDistortion ( const vpCameraParameters cam,
const double &  u,
const double &  v,
double &  x,
double &  y 
)
inlinestatic

Point coordinates conversion without distortion from pixel coordinates $(u,v)$ to normalized coordinates $(x,y)$ in meter.

Parameters
cam: camera parameters.
u: input coordinate in pixels along image horizontal axis.
v: input coordinate in pixels along image vertical axis.
x: output coordinate in meter along image plane x-axis.
y: output coordinate in meter along image plane y-axis.

$ x = (u-u_0)/p_x $ and $ y = (v-v_0)/p_y $

Definition at line 157 of file vpPixelMeterConversion.h.

static void vpPixelMeterConversion::convertPointWithoutDistortion ( const vpCameraParameters cam,
const vpImagePoint iP,
double &  x,
double &  y 
)
inlinestatic

Point coordinates conversion without distortion from pixel coordinates Coordinates in pixel to normalized coordinates $(x,y)$ in meter.

Parameters
cam: camera parameters.
iP: input coordinates in pixels.
x: output coordinate in meter along image plane x-axis.
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 :

$ x = (u-u_0)/p_x $ and $ y = (v-v_0)/p_y $

Definition at line 180 of file vpPixelMeterConversion.h.

References vpImagePoint::get_u(), and vpImagePoint::get_v().