Visual Servoing Platform  version 3.5.0 under development (2022-02-15)

#include <visp3/visual_features/vpFeatureBuilder.h>

Static Public Member Functions

static void create (vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
 
static void create (vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot2 &d)
 
static void create (vpFeaturePoint &s, const vpCameraParameters &cam, const vpImagePoint &t)
 
static void create (vpFeaturePoint &s, const vpPoint &p)
 
static void create (vpFeaturePoint &s, const vpCameraParameters &goodCam, const vpCameraParameters &wrongCam, const vpPoint &p)
 
static void create (vpFeatureSegment &s, const vpCameraParameters &cam, const vpDot &d1, const vpDot &d2)
 
static void create (vpFeatureSegment &s, const vpCameraParameters &cam, const vpDot2 &d1, const vpDot2 &d2)
 
static void create (vpFeatureSegment &s, const vpCameraParameters &cam, const vpImagePoint &ip1, const vpImagePoint &ip2)
 
static void create (vpFeatureSegment &s, vpPoint &P1, vpPoint &P2)
 
static void create (vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpDot &dot)
 
static void create (vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpDot2 &dot)
 
static void create (vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpImagePoint &iP)
 
static void create (vpFeaturePointPolar &s, const vpPoint &p)
 
static void create (vpFeaturePointPolar &s, const vpCameraParameters &goodCam, const vpCameraParameters &wrongCam, const vpPoint &p)
 
static void create (vpFeaturePoint3D &s, const vpPoint &p)
 
static void create (vpFeatureLine &s, const vpLine &l)
 
static void create (vpFeatureLine &s, const vpCylinder &c, int line)
 
static void create (vpFeatureLine &s, const vpCameraParameters &cam, const vpMeLine &mel)
 
static void create (vpFeatureEllipse &s, const vpCircle &c)
 
static void create (vpFeatureEllipse &s, const vpSphere &sphere)
 
static void create (vpFeatureEllipse &s, const vpCameraParameters &cam, const vpDot &blob)
 
static void create (vpFeatureEllipse &s, const vpCameraParameters &cam, const vpDot2 &blob)
 
static void create (vpFeatureEllipse &s, const vpCameraParameters &cam, const vpMeEllipse &ellipse)
 
static void create (vpFeatureVanishingPoint &s, const vpPoint &p, unsigned int select=(vpFeatureVanishingPoint::selectX()|vpFeatureVanishingPoint::selectY()))
 
static void create (vpFeatureVanishingPoint &s, const vpFeatureLine &l1, const vpFeatureLine &l2, unsigned int select=(vpFeatureVanishingPoint::selectX()|vpFeatureVanishingPoint::selectY()))
 
static void create (vpFeatureVanishingPoint &s, const vpLine &l1, const vpLine &l2, unsigned int select=(vpFeatureVanishingPoint::selectX()|vpFeatureVanishingPoint::selectY()))
 
static void create (vpFeatureVanishingPoint &s, const vpCameraParameters &cam, const vpImagePoint &line1_ip1, const vpImagePoint &line1_ip2, const vpImagePoint &line2_ip1, const vpImagePoint &line2_ip2, unsigned int select)
 

Detailed Description

Class that defines conversion between trackers and visual features.

Definition at line 92 of file vpFeatureBuilder.h.

Member Function Documentation

◆ create() [1/27]

void vpFeatureBuilder::create ( vpFeaturePoint s,
const vpCameraParameters cam,
const vpDot d 
)
static

Create a vpFeaturePoint thanks to a vpDot and the parameters of the camera. The vpDot contains only the pixel coordinates of the point in an image. Thus this method uses the camera parameters to compute the meter coordinates $ x $ and $ y $ in the image plan. Those coordinates are stored in the vpFeaturePoint.

Warning
It is not possible to compute the depth of the point $ Z $ in the camera frame thanks to a vpDot. This coordinate is needed in vpFeaturePoint to compute the interaction matrix. So this value must be computed outside this function.
Parameters
s: Visual feature $(x, y)$ to initialize. Be aware, the 3D depth $Z$ requested to compute the interaction matrix is not initialized by this function.
cam: The parameters of the camera used to acquire the image containing the vpDot.
d: The vpDot used to create the vpFeaturePoint.

The code below shows how to initialize a vpFeaturePoint visual feature. First, we initialize the $x,y$, and lastly we set the 3D depth $Z$ of the point which is generally the result of a pose estimation.

vpImage<unsigned char> I; // Image container
vpCameraParameters cam; // Default intrinsic camera parameters
vpDot dot; // Dot tracker
vpFeaturePoint s; // Point feature
...
// Tracking on the dot
dot.track(I);
// Initialize rho,theta visual feature
// A pose estimation is requested to initialize Z, the depth of the
// point in the camera frame.
double Z = 1; // Depth of the point in meters
....
s.set_Z(Z);
Examples:
manServo4PointsDisplay.cpp, manSimu4Dots.cpp, manSimu4Points.cpp, mbot-apriltag-2D-half-vs.cpp, servoAfma4Point2DArtVelocity.cpp, servoAfma4Point2DCamVelocity.cpp, servoAfma4Point2DCamVelocityKalman.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6Cylinder2DCamVelocity.cpp, servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp, servoAfma6Ellipse2DCamVelocity.cpp, servoAfma6FourPoints2DArtVelocity.cpp, servoAfma6FourPoints2DCamVelocityLs_cur.cpp, servoAfma6FourPoints2DCamVelocityLs_des.cpp, servoAfma6Line2DCamVelocity.cpp, servoAfma6Point2DArtVelocity.cpp, servoAfma6Point2DCamVelocity.cpp, servoAfma6Segment2DCamVelocity.cpp, servoAfma6SquareLines2DCamVelocity.cpp, servoAfma6TwoLines2DCamVelocity.cpp, servoBebop2.cpp, servoBiclopsPoint2DArtVelocity.cpp, servoFrankaIBVS.cpp, servoPioneerPanSegment3D.cpp, servoPioneerPoint2DDepth.cpp, servoPioneerPoint2DDepthWithoutVpServo.cpp, servoPtu46Point2DArtVelocity.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuCircle2DCamVelocity.cpp, servoSimuCircle2DCamVelocityDisplay.cpp, servoSimuCylinder.cpp, servoSimuCylinder2DCamVelocityDisplay.cpp, servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp, servoSimuFourPoints2DCamVelocity.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuLine2DCamVelocityDisplay.cpp, servoSimuPoint2DCamVelocity1.cpp, servoSimuPoint2DCamVelocity2.cpp, servoSimuPoint2DCamVelocity3.cpp, servoSimuPoint2DhalfCamVelocity1.cpp, servoSimuPoint2DhalfCamVelocity2.cpp, servoSimuPoint2DhalfCamVelocity3.cpp, servoSimuSphere2DCamVelocity.cpp, servoSimuSphere2DCamVelocityDisplay.cpp, servoSimuSphere2DCamVelocityDisplaySecondaryTask.cpp, servoSimuSquareLine2DCamVelocityDisplay.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, servoViper650FourPoints2DArtVelocityLs_cur.cpp, servoViper650FourPoints2DCamVelocityLs_cur-SR300.cpp, servoViper650FourPoints2DCamVelocityLs_cur.cpp, servoViper650Point2DCamVelocity.cpp, servoViper850FourPoints2DArtVelocityLs_cur.cpp, servoViper850FourPoints2DArtVelocityLs_des.cpp, servoViper850FourPoints2DCamVelocityLs_cur.cpp, servoViper850FourPointsKinect.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp, servoViper850Point2DArtVelocity-jointAvoidance-large.cpp, servoViper850Point2DArtVelocity.cpp, servoViper850Point2DCamVelocity.cpp, servoViper850Point2DCamVelocityKalman.cpp, simulateCircle2DCamVelocity.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, testFeatureSegment.cpp, testPoseFeatures.cpp, testTrackDot.cpp, trackMeLine.cpp, tutorial-ibvs-4pts-display.cpp, tutorial-ibvs-4pts-image-tracking.cpp, tutorial-ibvs-4pts-ogre-tracking.cpp, tutorial-ibvs-4pts-ogre.cpp, tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter.cpp, tutorial-ibvs-4pts-wireframe-camera.cpp, tutorial-ibvs-4pts-wireframe-robot-afma6.cpp, tutorial-ibvs-4pts-wireframe-robot-viper.cpp, tutorial-ibvs-4pts.cpp, tutorial-simu-pioneer-continuous-gain-adaptive.cpp, tutorial-simu-pioneer-continuous-gain-constant.cpp, tutorial-simu-pioneer-pan.cpp, and tutorial-simu-pioneer.cpp.

Definition at line 93 of file vpFeatureBuilderPoint.cpp.

References vpPixelMeterConversion::convertPoint(), vpDot::getCog(), vpFeaturePoint::set_x(), vpFeaturePoint::set_y(), and vpERROR_TRACE.

Referenced by vpVirtualGrabber::acquire(), vpPoseFeatures::addFeatureEllipse(), vpPoseFeatures::addFeatureLine(), vpPoseFeatures::addFeaturePoint(), vpPoseFeatures::addFeaturePoint3D(), vpPoseFeatures::addFeatureSegment(), vpPoseFeatures::addFeatureVanishingPoint(), vpMbtDistanceCircle::computeInteractionMatrixError(), vpMbtDistanceLine::computeInteractionMatrixError(), vpMbtDistanceCylinder::computeInteractionMatrixError(), and create().

◆ create() [2/27]

void vpFeatureBuilder::create ( vpFeaturePoint s,
const vpCameraParameters cam,
const vpDot2 d 
)
static

Create a vpFeaturePoint thanks to a vpDot2 and the parameters of the camera. The vpDot2 contains only the pixel coordinates of the point in an image. Thus this method uses the camera parameters to compute the meter coordinates $ x $ and $ y $ in the image plan. Those coordinates are stored in the vpFeaturePoint.

Warning
It is not possible to compute the depth of the point $ Z $ in the camera frame thanks to a vpDot2. This coordinate is needed in vpFeaturePoint to compute the interaction matrix. So this value must be computed outside this function.
Parameters
s: The feature point.
cam: The parameters of the camera used to acquire the image containing the vpDot2.
d: The vpDot2 used to create the vpFeaturePoint.

The code below shows how to initialize a vpFeaturePoint visual feature. First, we initialize the $x,y$, and lastly we set the 3D depth $Z$ of the point which is generally the result of a pose estimation.

vpImage<unsigned char> I; // Image container
vpCameraParameters cam; // Default intrinsic camera parameters
vpDot2 dot; // Dot tracker
vpFeaturePoint s; // Point feature
...
// Tracking on the dot
dot.track(I);
// Initialize rho,theta visual feature
// A pose estimation is requested to initialize Z, the depth of the
// point in the camera frame.
double Z = 1; // Depth of the point in meters
....
s.set_Z(Z);

Definition at line 153 of file vpFeatureBuilderPoint.cpp.

References vpPixelMeterConversion::convertPoint(), vpDot2::getCog(), vpFeaturePoint::set_x(), vpFeaturePoint::set_y(), and vpERROR_TRACE.

◆ create() [3/27]

void vpFeatureBuilder::create ( vpFeaturePoint s,
const vpCameraParameters cam,
const vpImagePoint ip 
)
static

Create a vpFeaturePoint thanks to a vpImagePoint and the parameters of the camera. The vpImagePoint contains only the pixel coordinates of the point in an image. Thus this method uses the camera parameters to compute the meter coordinates $ x $ and $ y $ in the image plan. Those coordinates are stored in the vpFeaturePoint.

Warning
It is not possible to compute the depth of the point $ Z $ in the camera frame thanks to a vpImagePoint. This coordinate is needed in vpFeaturePoint to compute the interaction matrix. So this value must be computed outside this function.
Parameters
s: The feature point.
cam: The parameters of the camera used to acquire the image containing the point.
ip: The vpImagePoint used to create the vpFeaturePoint.

The code below shows how to initialize a vpFeaturePoint visual feature. First, we initialize the $x,y$, and lastly we set the 3D depth $Z$ of the point which is generally the result of a pose estimation.

vpImage<unsigned char> I; // Image container
vpCameraParameters cam; // Default intrinsic camera parameters
vpImagePoint iP; // the point in the image
vpFeaturePoint s; // Point feature
...
// Set the point coordinates in the image (here the coordinates are given in
the (i,j) frame iP.set_i(0); iP.set_j(0);
// Initialize rho,theta visual feature
// A pose estimation is requested to initialize Z, the depth of the
// point in the camera frame.
double Z = 1; // Depth of the point in meters
....
s.set_Z(Z);

Definition at line 214 of file vpFeatureBuilderPoint.cpp.

References vpPixelMeterConversion::convertPoint(), vpFeaturePoint::set_x(), vpFeaturePoint::set_y(), and vpERROR_TRACE.

◆ create() [4/27]

void vpFeatureBuilder::create ( vpFeaturePoint s,
const vpPoint p 
)
static

Create a vpFeaturePoint thanks to a vpPoint. This method uses the point coordinates $ x $ and $ y $ in the image plan to set the visual feature parameters. The value of the depth $ Z $ in the camera frame is also computed thanks to the coordinates in the camera frame which are stored in vpPoint.

Warning
To be sure that the vpFeaturePoint is well initialized, you have to be sure that at least the point coordinates in the image plan and in the camera frame are computed and stored in the vpPoint.
Parameters
s: The feature point.
p: The vpPoint used to create the vpFeaturePoint.

Definition at line 243 of file vpFeatureBuilderPoint.cpp.

References vpFeatureException::badInitializationError, vpTracker::cP, vpPoint::get_x(), vpPoint::get_y(), vpFeaturePoint::get_Z(), vpFeaturePoint::set_x(), vpFeaturePoint::set_y(), vpFeaturePoint::set_Z(), and vpERROR_TRACE.

◆ create() [5/27]

void vpFeatureBuilder::create ( vpFeaturePoint s,
const vpCameraParameters goodCam,
const vpCameraParameters wrongCam,
const vpPoint p 
)
static

Create a vpFeaturePoint thanks to a vpPoint. In this method noise is introduced during the initialization of the vpFeaturePoint. This method uses the point coordinates $ x $ and $ y $ in the image plan to set the visual feature parameters. The value of the depth $ Z $ in the camera frame is also computed thanks to the coordinates in the camera frame which are stored in vpPoint.

This function intends to introduce noise after the initialization of the parameters. Cartesian $(x,y)$ coordinates are first converted in pixel coordinates in the image using goodCam camera parameters. Then, the pixels coordinates of the point are converted back to cartesian coordinates $(x^{'},y^{'})$ using the noisy camera parameters wrongCam. These last parameters are stored in the vpFeaturePoint.

Warning
To be sure that the vpFeaturePoint is well initialized, you have to be sure that at least the point coordinates in the image plan and in the camera frame are computed and stored in the vpPoint.
Parameters
s: The feature point.
goodCam: Camera parameters used to introduce noise. These parameters are used to convert cartesian coordinates of the point p in the image plane in pixel coordinates.
wrongCam: Camera parameters used to introduce noise. These parameters are used to convert pixel coordinates of the point in cartesian coordinates of the point in the image plane.
p: The vpPoint used to create the vpFeaturePoint.

Definition at line 302 of file vpFeatureBuilderPoint.cpp.

References vpPixelMeterConversion::convertPoint(), vpMeterPixelConversion::convertPoint(), vpTracker::cP, vpTracker::p, vpFeaturePoint::set_x(), vpFeaturePoint::set_y(), vpFeaturePoint::set_Z(), and vpERROR_TRACE.

◆ create() [6/27]

void vpFeatureBuilder::create ( vpFeatureSegment s,
const vpCameraParameters cam,
const vpDot d1,
const vpDot d2 
)
static

Initialize a segment feature out of vpDots and camera parameters.

Parameters
s: Visual feature to initialize.
cam: The parameters of the camera used to acquire the image containing the point.
d1: The dot corresponding to the first point of the segment.
d2: The dot corresponding to the second point of the segment.

Definition at line 60 of file vpFeatureBuilderSegment.cpp.

References vpPixelMeterConversion::convertPoint(), vpDot::getCog(), vpFeatureSegment::isNormalized(), vpFeatureSegment::setAlpha(), vpFeatureSegment::setL(), vpFeatureSegment::setXc(), and vpFeatureSegment::setYc().

◆ create() [7/27]

void vpFeatureBuilder::create ( vpFeatureSegment s,
const vpCameraParameters cam,
const vpDot2 d1,
const vpDot2 d2 
)
static

Initialize a segment feature out of vpDots and camera parameters.

Parameters
s: Visual feature to initialize.
cam: The parameters of the camera used to acquire the image containing the point.
d1: The dot corresponding to the first point of the segment.
d2: The dot corresponding to the second point of the segment.

Definition at line 94 of file vpFeatureBuilderSegment.cpp.

References vpPixelMeterConversion::convertPoint(), vpDot2::getCog(), vpFeatureSegment::isNormalized(), vpFeatureSegment::setAlpha(), vpFeatureSegment::setL(), vpFeatureSegment::setXc(), and vpFeatureSegment::setYc().

◆ create() [8/27]

void vpFeatureBuilder::create ( vpFeatureSegment s,
const vpCameraParameters cam,
const vpImagePoint ip1,
const vpImagePoint ip2 
)
static

Initialize a segment feature out of image points and camera parameters.

Parameters
s: Visual feature to initialize.
cam: The parameters of the camera used to acquire the image containing the point.
ip1: The image point corresponding to the first point of the segment.
ip2: The image point corresponding to the second point of the segment.

Definition at line 129 of file vpFeatureBuilderSegment.cpp.

References vpPixelMeterConversion::convertPoint(), vpFeatureSegment::isNormalized(), vpFeatureSegment::setAlpha(), vpFeatureSegment::setL(), vpFeatureSegment::setXc(), and vpFeatureSegment::setYc().

◆ create() [9/27]

void vpFeatureBuilder::create ( vpFeatureSegment s,
vpPoint P1,
vpPoint P2 
)
static

Build a segment visual feature from two points.

Parameters
s: Visual feature to initialize.
P1,P2: Two points defining the segment. These points must contain the 3D coordinates in the camera frame (cP) and the projected coordinates in the image plane (p).

Definition at line 164 of file vpFeatureBuilderSegment.cpp.

References vpFeatureSegment::buildFrom(), vpTracker::cP, vpPoint::get_x(), and vpPoint::get_y().

◆ create() [10/27]

void vpFeatureBuilder::create ( vpFeaturePointPolar s,
const vpCameraParameters cam,
const vpDot dot 
)
static

Initialize a point feature with polar coordinates $(\rho,\theta)$ using the coordinates of the point in pixels obtained by image processing. This point is the center of gravity of a dot tracked using vpDot. Using the camera parameters, the pixels coordinates of the dot are first converted in cartesian $(x,y)$ coordinates in meter in the camera frame and than in polar coordinates by:

\[\rho = \sqrt{x^2+y^2} \hbox{,}\; \; \theta = \arctan \frac{y}{x}\]

Warning
This function does not initialize $Z$ which is requested to compute the interaction matrix by vpfeaturePointPolar::interaction().
Parameters
s: Visual feature $(\rho,\theta)$ to initialize. Be aware, the 3D depth $Z$ requested to compute the interaction matrix is not initialized by this function.
cam: Camera parameters.
dot: Tracked dot. The center of gravity corresponds to the coordinates of the point in the image plane.

The code below shows how to initialize a vpFeaturePointPolar visual feature. First, we initialize the $\rho,\theta$, and lastly we set the 3D depth $Z$ of the point which is generally the result of a pose estimation.

vpImage<unsigned char> I; // Image container
vpCameraParameters cam; // Default intrinsic camera parameters
vpDot2 dot; // Dot tracker
vpFeaturePointPolar s; // Point feature with polar coordinates
...
// Tracking on the dot
dot.track(I);
// Initialize rho,theta visual feature
// A pose estimation is requested to initialize Z, the depth of the
// point in the camera frame.
double Z = 1; // Depth of the point in meters
....
s.set_Z(Z);

Definition at line 102 of file vpFeatureBuilderPointPolar.cpp.

References vpPixelMeterConversion::convertPoint(), vpDot::getCog(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_theta(), and vpERROR_TRACE.

◆ create() [11/27]

void vpFeatureBuilder::create ( vpFeaturePointPolar s,
const vpCameraParameters cam,
const vpDot2 dot 
)
static

Initialize a point feature with polar coordinates $(\rho,\theta)$ using the coordinates of the point in pixels obtained by image processing. This point is the center of gravity of a dot tracked using vpDot2. Using the camera parameters, the pixels coordinates of the dot are first converted in cartesian $(x,y)$ coordinates in meter in the camera frame and than in polar coordinates by:

\[\rho = \sqrt{x^2+y^2} \hbox{,}\; \; \theta = \arctan \frac{y}{x}\]

Warning
This function does not initialize $Z$ which is requested to compute the interaction matrix by vpfeaturePointPolar::interaction().
Parameters
s: Visual feature $(\rho,\theta)$ to initialize. Be aware, the 3D depth $Z$ requested to compute the interaction matrix is not initialized by this function.
cam: Camera parameters.
dot: Tracked dot. The center of gravity corresponds to the coordinates of the point in the image plane.

The code below shows how to initialize a vpFeaturePointPolar visual feature. First, we initialize the $\rho,\theta$, and lastly we set the 3D depth $Z$ of the point which is generally the result of a pose estimation.

vpImage<unsigned char> I; // Image container
vpCameraParameters cam; // Default intrinsic camera parameters
vpDot2 dot; // Dot tracker
vpFeaturePointPolar s; // Point feature with polar coordinates
...
// Tracking on the dot
dot.track(I);
// Initialize rho,theta visual feature
// A pose estimation is requested to initialize Z, the depth of the
// point in the camera frame.
double Z = 1; // Depth of the point in meters
....
s.set_Z(Z);

Definition at line 174 of file vpFeatureBuilderPointPolar.cpp.

References vpPixelMeterConversion::convertPoint(), vpDot2::getCog(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_theta(), and vpERROR_TRACE.

◆ create() [12/27]

void vpFeatureBuilder::create ( vpFeaturePointPolar s,
const vpCameraParameters cam,
const vpImagePoint iP 
)
static

Initialize a point feature with polar coordinates $(\rho,\theta)$ using the coordinates of the point in pixels obtained by image processing. The points coordinates are stored in a vpImagePoint. Using the camera parameters, the pixels coordinates of the point are first converted in cartesian $(x,y)$ coordinates in meter in the camera frame and than in polar coordinates by:

\[\rho = \sqrt{x^2+y^2} \hbox{,}\; \; \theta = \arctan \frac{y}{x}\]

Warning
This function does not initialize $Z$ which is requested to compute the interaction matrix by vpfeaturePointPolar::interaction().
Parameters
s: Visual feature $(\rho,\theta)$ to initialize. Be aware, the 3D depth $Z$ requested to compute the interaction matrix is not initialized by this function.
cam: Camera parameters.
iP: The vpImagePoint used to create the vpFeaturePoint.

The code below shows how to initialize a vpFeaturePointPolar visual feature. First, we initialize the $\rho,\theta$, and lastly we set the 3D depth $Z$ of the point which is generally the result of a pose estimation.

vpImage<unsigned char> I; // Image container
vpCameraParameters cam; // Default intrinsic camera parameters
vpImagePoint iP; // the point in the image
vpFeaturePointPolar s; // Point feature with polar coordinates
...
// Set the point coordinates in the image (here the coordinates are given in
the (i,j) frame iP.set_i(0); iP.set_j(0);
// Initialize rho,theta visual feature
// A pose estimation is requested to initialize Z, the depth of the
// point in the camera frame.
double Z = 1; // Depth of the point in meters
....
s.set_Z(Z);

Definition at line 245 of file vpFeatureBuilderPointPolar.cpp.

References vpPixelMeterConversion::convertPoint(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_theta(), and vpERROR_TRACE.

◆ create() [13/27]

void vpFeatureBuilder::create ( vpFeaturePointPolar s,
const vpPoint p 
)
static

Initialize a point feature with polar coordinates $(\rho,\theta)$ using the coordinates of the point $(x,y,Z)$, where $(x,y)$ correspond to the perspective projection of the point in the image plane and $Z$ the 3D depth of the point in the camera frame. The values of $(x,y,Z)$ are expressed in meters. From the coordinates in the image plane, the polar coordinates are computed by:

\[\rho = \sqrt{x^2+y^2} \hbox{,}\; \; \theta = \arctan \frac{y}{x}\]

Parameters
s: Visual feature $(\rho,\theta)$ and $Z$ to initialize.
p: A point with $(x,y)$ cartesian coordinates in the image plane corresponding to the camera perspective projection, and with 3D depth $Z$.

Definition at line 281 of file vpFeatureBuilderPointPolar.cpp.

References vpFeatureException::badInitializationError, vpPoint::get_x(), vpPoint::get_y(), vpPoint::get_Z(), vpFeaturePointPolar::get_Z(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_theta(), vpFeaturePointPolar::set_Z(), and vpERROR_TRACE.

◆ create() [14/27]

void vpFeatureBuilder::create ( vpFeaturePointPolar s,
const vpCameraParameters goodCam,
const vpCameraParameters wrongCam,
const vpPoint p 
)
static

Initialize a point feature with polar coordinates $(\rho,\theta)$ using the coordinates of the point $(x,y,Z)$, where $(x,y)$ correspond to the perspective projection of the point in the image plane and $Z$ the 3D depth of the point in the camera frame. The values of $(x,y,Z)$ are expressed in meters.

This function intends to introduce noise in the conversion from cartesian to polar coordinates. Cartesian $(x,y)$ coordinates are first converted in pixel coordinates in the image using goodCam camera parameters. Then, the pixels coordinates of the point are converted back to cartesian coordinates $(x^{'},y^{'})$ using the noisy camera parameters wrongCam. From these new coordinates in the image plane, the polar coordinates are computed by:

\[\rho = \sqrt{x^2+y^2} \hbox{,}\; \; \theta = \arctan \frac{y}{x}\]

Parameters
s: Visual feature $(\rho,\theta)$ and $Z$ to initialize.
goodCam: Camera parameters used to introduce noise. These parameters are used to convert cartesian coordinates of the point p in the image plane in pixel coordinates.
wrongCam: Camera parameters used to introduce noise. These parameters are used to convert pixel coordinates of the point in cartesian coordinates of the point in the image plane.
p: A point with $(x,y)$ cartesian coordinates in the image plane corresponding to the camera perspective projection, and with 3D depth $Z$.

Definition at line 349 of file vpFeatureBuilderPointPolar.cpp.

References vpPixelMeterConversion::convertPoint(), vpMeterPixelConversion::convertPoint(), vpPoint::get_x(), vpPoint::get_y(), vpPoint::get_Z(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_theta(), vpFeaturePointPolar::set_Z(), and vpERROR_TRACE.

◆ create() [15/27]

void vpFeatureBuilder::create ( vpFeaturePoint3D s,
const vpPoint t 
)
static

Initialize a 3D point feature using the coordinates of the point $(X,Y,Z)$ in the camera frame. The values of $(X,Y,Z)$ are expressed in meters.

Warning
To be sure that the vpFeaturePoint is well initialized, you have to be sure that at least the point coordinates in the camera frame are computed and stored in the vpPoint.
Parameters
s: Visual feature to initialize.
t: The vpPoint used to create the vpFeaturePoint.

Definition at line 62 of file vpFeatureBuilderPoint3D.cpp.

References vpTracker::cP, vpFeaturePoint3D::set_X(), vpFeaturePoint3D::set_Y(), vpFeaturePoint3D::set_Z(), and vpERROR_TRACE.

◆ create() [16/27]

void vpFeatureBuilder::create ( vpFeatureLine s,
const vpLine t 
)
static

Initialize a line feature thanks to a vpLine. A vpFeatureLine contains the parameters $(\rho,\theta)$ which are expressed in meter. It also contains the parameters of a plan equation $(A,B,C,D)$. In vpLine there are the parameters of two plans, but the one which have the biggest D parameter is copied in the vpFeatureLine parameters.

Parameters
s: Visual feature to initialize.
t: The vpLine used to create the vpFeatureLine.

Definition at line 60 of file vpFeatureBuilderLine.cpp.

References vpTracker::cP, vpLine::getRho(), vpLine::getTheta(), vpFeatureLine::setABCD(), vpFeatureLine::setRhoTheta(), and vpERROR_TRACE.

◆ create() [17/27]

void vpFeatureBuilder::create ( vpFeatureLine s,
const vpCylinder t,
int  line 
)
static

Initialize a line feature thanks to a vpCylinder. A vpFeatureLine contains the parameters $(\rho,\theta)$ which are expressed in meter. It also contains the parameters of a plan equation $(A,B,C,D)$. These parameters are computed thanks to the parameters that are contained in vpCylinder. It is possible to choose which edge of the cylinder to use to initialize the vpFeatureLine.

Parameters
s: Visual feature to initialize.
t: The vpLine used to create the vpFeatureLine.
line: The cylinder edge used to create the line feature. It can be vpCylinder::line1 or vpCylinder::line2.

Definition at line 102 of file vpFeatureBuilderLine.cpp.

References vpCylinder::getA(), vpCylinder::getB(), vpCylinder::getC(), vpCylinder::getR(), vpCylinder::getRho1(), vpCylinder::getRho2(), vpCylinder::getTheta1(), vpCylinder::getTheta2(), vpCylinder::getX(), vpCylinder::getY(), vpCylinder::getZ(), vpCylinder::line1, vpFeatureLine::setABCD(), vpFeatureLine::setRhoTheta(), vpMath::sqr(), and vpERROR_TRACE.

◆ create() [18/27]

void vpFeatureBuilder::create ( vpFeatureLine s,
const vpCameraParameters cam,
const vpMeLine t 
)
static

Initialize a line feature thanks to a vpMeLine and the parameters of the camera. A vpFeatureLine contains the parameters $(\rho,\theta)$ which are expressed in meter. In vpMeLine these parameters are given in pixel. The conversion is done thanks to the camera parameters.

Warning
vpFeatureLine also contains the parameters of a plan equation $(A,B,C,D)$. These parameters are needed to compute the interaction matrix but can not be computed thanks to a vpMeLine. You have to compute and set these parameters outside the function.
Parameters
s: Visual feature to initialize.
cam: The parameters of the camera used to acquire the image containing the line.
t: The vpLine used to create the vpFeatureLine.

The code below shows how to initialize a vpFeatureLine visual feature. First, we initialize the $(\rho,\theta)$, and lastly we set the parameters of the plane which is generally the result of a pose estimation.

vpImage<unsigned char> I; // Image container
vpCameraParameters cam; // Default intrinsic camera parameters
vpMeLine line; // Moving-edges line tracker
vpFeatureLine s; // Point feature
...
// Tracking on the dot
line.track(I);
// Initialize rho,theta visual feature
// A pose estimation is requested to initialize A, B, C and D the
//parameters of the equation plan.
double A = 1;
double B = 1;
double C = 1;
double D = 1;
....
s.setABCD(A,B,C,D);

Definition at line 194 of file vpFeatureBuilderLine.cpp.

References vpFeatureLine::buildFrom(), vpPixelMeterConversion::convertLine(), vpMeLine::getRho(), vpMeLine::getTheta(), and vpERROR_TRACE.

◆ create() [19/27]

void vpFeatureBuilder::create ( vpFeatureEllipse s,
const vpCircle t 
)
static

create vpFeatureEllipse feature

Initialize an ellipse feature thanks to a vpCircle. The vpFeatureEllipse is initialized thanks to the parameters of the circle in the camera frame and in the image plane. All the parameters are given in meter.

Warning
To be sure that the vpFeatureEllipse is well initialized, you have to be sure that at least the circle coordinates in the image plane and in the camera frame are computed and stored in the vpCircle.
Parameters
s: Visual feature to initialize.
t: The vpCircle used to create the vpFeatureEllipse.

Definition at line 62 of file vpFeatureBuilderEllipse.cpp.

References vpFeatureEllipse::buildFrom(), vpTracker::cP, vpTracker::p, and vpFeatureEllipse::setABC().

◆ create() [20/27]

void vpFeatureBuilder::create ( vpFeatureEllipse s,
const vpSphere t 
)
static

Initialize an ellipse feature thanks to a vpSphere. The vpFeatureEllipse is initialized thanks to the parameters of the sphere in the camera frame and in the image plan. All the parameters are given in meter.

Warning
To be sure that the vpFeatureEllipse is well initialized, you have to be sure that at least the sphere coordinates in the image plan and in the camera frame are computed and stored in the vpSphere.
Parameters
s: Visual feature to initialize.
t: The vpSphere used to create the vpFeatureEllipse.

Definition at line 100 of file vpFeatureBuilderEllipse.cpp.

References vpFeatureEllipse::buildFrom(), vpTracker::cP, vpTracker::p, vpFeatureEllipse::setABC(), and vpMath::sqr().

◆ create() [21/27]

void vpFeatureBuilder::create ( vpFeatureEllipse s,
const vpCameraParameters cam,
const vpDot blob 
)
static

Initialize an ellipse feature thanks to a vpDot and camera parameters. The vpFeatureEllipse is initialized thanks to the parameters of the dot given in pixel. The camera parameters are used to convert the pixel parameters to parameters given in meter.

Warning
With a vpDot there is no information about 3D parameters. Thus the parameters $(A,B,C)$ can not be set. You have to compute them and initialized them outside the method.
Parameters
s: Visual feature to initialize.
cam: The parameters of the camera used to acquire the image containing the vpDot.
blob: The blob used to create the vpFeatureEllipse.

Definition at line 138 of file vpFeatureBuilderEllipse.cpp.

References vpFeatureEllipse::buildFrom(), vpPixelMeterConversion::convertPoint(), vpDot::get_nij(), and vpDot::getCog().

◆ create() [22/27]

void vpFeatureBuilder::create ( vpFeatureEllipse s,
const vpCameraParameters cam,
const vpDot2 blob 
)
static

Initialize an ellipse feature thanks to a vpDot2 and camera parameters. The vpFeatureEllipse is initialized thanks to the parameters of the dot given in pixel. The camera parameters are used to convert the pixel parameters to parameters given in meter.

Warning
With a vpDot2 there is no information about 3D parameters. Thus the parameters $(A,B,C)$ can not be set. You have to compute them and initialized them outside the method.
Parameters
s: Visual feature to initialize.
cam: The parameters of the camera used to acquire the image containing the vpDot2.
blob: The blob used to create the vpFeatureEllipse.

Definition at line 164 of file vpFeatureBuilderEllipse.cpp.

References vpFeatureEllipse::buildFrom(), vpPixelMeterConversion::convertPoint(), vpDot2::get_nij(), and vpDot2::getCog().

◆ create() [23/27]

void vpFeatureBuilder::create ( vpFeatureEllipse s,
const vpCameraParameters cam,
const vpMeEllipse ellipse 
)
static

Initialize an ellipse feature thanks to a vpMeEllipse and camera parameters. The vpFeatureEllipse is initialized thanks to the parameters of the ellipse given in pixel. The camera parameters are used to convert the pixel parameters to parameters given in meters in the image plane.

Warning
With a vpMeEllipse there is no information about 3D parameters. Thus the parameters $(A,B,C)$ can not be set. You have to compute them and initialize them outside the method.
Parameters
[out]s: Visual feature to initialize.
[in]cam: The parameters of the camera used to acquire the image containing the vpMeEllipse
[in]ellipse: The tracked vpMeEllipse used to create the vpFeatureEllipse.

Definition at line 192 of file vpFeatureBuilderEllipse.cpp.

References vpFeatureEllipse::buildFrom(), vpPixelMeterConversion::convertEllipse(), vpMeEllipse::get_nij(), and vpMeEllipse::getCenter().

◆ create() [24/27]

void vpFeatureBuilder::create ( vpFeatureVanishingPoint s,
const vpPoint p,
unsigned int  select = (vpFeatureVanishingPoint::selectX() | vpFeatureVanishingPoint::selectY()) 
)
static

Initialize a vpFeatureVanishingPoint thanks to a vpPoint. The vpFeatureVanishingPoint is initialized thanks to the parameters of the point in the image plane. All the parameters are given in meter.

Parameters
s: Visual feature to initialize; either $ {\bf s} = (x, y) $ or either $ {\bf s} = (1/\rho, \alpha) $ depending on select parameter.
p: The vpPoint with updated $ (x, y) $ coordinates in the image plane that are used to create the vpFeatureVanishingPoint.
select: Use either vpFeatureVanishingPoint::selectX() or vpFeatureVanishingPoint::selectY() to build $ {\bf s} = (x, y) $ visual feature, or use rather select vpFeatureVanishingPoint::selectOneOverRho() or vpFeatureVanishingPoint::selectAlpha() to build $ {\bf s} = (1/\rho, \alpha) $ visual feature.

Definition at line 64 of file vpFeatureBuilderVanishingPoint.cpp.

References vpPoint::get_x(), vpPoint::get_y(), vpFeatureVanishingPoint::selectAlpha(), vpFeatureVanishingPoint::selectOneOverRho(), vpFeatureVanishingPoint::selectX(), vpFeatureVanishingPoint::selectY(), vpFeatureVanishingPoint::set_x(), vpFeatureVanishingPoint::set_y(), vpFeatureVanishingPoint::setAlpha(), and vpFeatureVanishingPoint::setOneOverRho().

◆ create() [25/27]

void vpFeatureBuilder::create ( vpFeatureVanishingPoint s,
const vpFeatureLine L1,
const vpFeatureLine L2,
unsigned int  select = (vpFeatureVanishingPoint::selectX() | vpFeatureVanishingPoint::selectY()) 
)
static

Initialize a vpFeatureVanishingPoint thanks to two vpFeatureLine. The vpFeatureVanishingPoint is initialized thanks to the coordinate of the intersection point in the image plan. All the parameters are given in meter.

Parameters
s: Visual feature to initialize; either $ {\bf s} = (x, y) $ or rather $ {\bf s} = (1/\rho, \alpha) $ depending on select parameter.
L1: The first vpFeatureLine.
L2: The second vpFeatureLine.
select: Use either vpFeatureVanishingPoint::selectX() or vpFeatureVanishingPoint::selectY() to build $ {\bf s} = (x, y) $ visual feature, or use rather select vpFeatureVanishingPoint::selectOneOverRho() or vpFeatureVanishingPoint::selectAlpha() to build $ {\bf s} = (1/\rho, \alpha) $ visual feature.
Warning
An exception is thrown if the two lines are parallel when cartesian coordinates $ {\bf s} = (x, y) $ are used.

Definition at line 98 of file vpFeatureBuilderVanishingPoint.cpp.

References vpFeatureException::badInitializationError, vpFeatureLine::getRho(), vpFeatureLine::getTheta(), vpFeatureVanishingPoint::selectAlpha(), vpFeatureVanishingPoint::selectOneOverRho(), vpFeatureVanishingPoint::selectX(), vpFeatureVanishingPoint::selectY(), vpFeatureVanishingPoint::set_x(), vpFeatureVanishingPoint::set_y(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setOneOverRho(), and vpCERROR.

◆ create() [26/27]

void vpFeatureBuilder::create ( vpFeatureVanishingPoint s,
const vpLine L1,
const vpLine L2,
unsigned int  select = (vpFeatureVanishingPoint::selectX() | vpFeatureVanishingPoint::selectY()) 
)
static

Initialize a vpFeatureVanishingPoint thanks to two vpLine. The vpFeatureVanishingPoint is initialized thanks to the coordinate of the intersection point in the image plan. All the parameters are given in meter.

Parameters
s: Visual feature to initialize; either $ {\bf s} = (x, y) $ or rather $ {\bf s} = (1/\rho, \alpha) $ depending on select parameter.
L1: The first vpLine.
L2: The second vpLine.
select: Use either vpFeatureVanishingPoint::selectX() or vpFeatureVanishingPoint::selectY() to build $ {\bf s} = (x, y) $ visual feature, or use rather select vpFeatureVanishingPoint::selectOneOverRho() or vpFeatureVanishingPoint::selectAlpha() to build $ {\bf s} = (1/\rho, \alpha) $ visual feature.
Warning
An exception is thrown if the two lines are parallel when cartesian coordinates $ {\bf s} = (x, y) $ are used.

Definition at line 163 of file vpFeatureBuilderVanishingPoint.cpp.

References create().

◆ create() [27/27]

void vpFeatureBuilder::create ( vpFeatureVanishingPoint s,
const vpCameraParameters cam,
const vpImagePoint line1_ip1,
const vpImagePoint line1_ip2,
const vpImagePoint line2_ip1,
const vpImagePoint line2_ip2,
unsigned int  select 
)
static

Initialize a vpFeatureVanishingPoint thanks to two vpLine. The vpFeatureVanishingPoint is initialized thanks to the coordinate of the intersection point in the image plan. All the parameters are given in meter.

Parameters
s: Visual feature to initialize; either $ {\bf s} = (x, y) $ or rather $ {\bf s} = (1/\rho, \alpha) $ depending on select parameter.
cam: Camera parameters used to convert image point coordinates from pixel in meter in the image plane.
line1_ip1,line1_ip2: The first line defined by 2 image points with pixel coordinates in the image.
line2_ip1,line2_ip2: The second line defined by 2 image points with pixel coordinates in the image.
select: Use either vpFeatureVanishingPoint::selectX() or vpFeatureVanishingPoint::selectY() to build $ {\bf s} = (x, y) $ visual feature, or use rather select vpFeatureVanishingPoint::selectOneOverRho() or vpFeatureVanishingPoint::selectAlpha() to build $ {\bf s} = (1/\rho, \alpha) $ visual feature.

Definition at line 189 of file vpFeatureBuilderVanishingPoint.cpp.

References vpPixelMeterConversion::convertPoint(), vpException::fatalError, vpFeatureVanishingPoint::selectAtanOneOverRho(), vpFeatureVanishingPoint::selectOneOverRho(), vpFeatureVanishingPoint::selectX(), vpFeatureVanishingPoint::selectY(), vpFeatureVanishingPoint::set_x(), vpFeatureVanishingPoint::set_y(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), and vpFeatureVanishingPoint::setOneOverRho().