Visual Servoing Platform  version 3.0.0
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,v: input coordinates in pixels.
x,y: output coordinates in meter.

$ 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, and tutorial-pose-from-points-tracking.cpp.

Definition at line 90 of file vpPixelMeterConversion.h.

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

Referenced by vpFeatureLuminance::buildFrom(), vpKeyPoint::compute3D(), 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,y: output coordinates in meter.

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 127 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,v: input coordinates in pixels.
x,y: output coordinates in meter.

$ 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 196 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,y: output coordinates in meter.

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 222 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,v: input coordinates in pixels.
x,y: output coordinates in meter.

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

Definition at line 152 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,y: output coordinates in meter.

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 174 of file vpPixelMeterConversion.h.

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