Visual Servoing Platform
version 3.3.0 under development (2020-02-17)
|
#include <visp3/visual_features/vpFeatureBuilder.h>
Class that defines conversion between trackers and visual features.
Definition at line 92 of file vpFeatureBuilder.h.
|
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 and in the image plan. Those coordinates are stored in the vpFeaturePoint.
s | : Visual feature to initialize. Be aware, the 3D depth 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 , and lastly we set the 3D depth of the point which is generally the result of a pose estimation.
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().
|
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 and in the image plan. Those coordinates are stored in the vpFeaturePoint.
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 , and lastly we set the 3D depth of the point which is generally the result of a pose estimation.
Definition at line 153 of file vpFeatureBuilderPoint.cpp.
References vpPixelMeterConversion::convertPoint(), vpDot2::getCog(), vpFeaturePoint::set_x(), vpFeaturePoint::set_y(), and vpERROR_TRACE.
|
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 and in the image plan. Those coordinates are stored in the vpFeaturePoint.
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 , and lastly we set the 3D depth of the point which is generally the result of a pose estimation.
Definition at line 214 of file vpFeatureBuilderPoint.cpp.
References vpPixelMeterConversion::convertPoint(), vpFeaturePoint::set_x(), vpFeaturePoint::set_y(), and vpERROR_TRACE.
|
static |
Create a vpFeaturePoint thanks to a vpPoint. This method uses the point coordinates and in the image plan to set the visual feature parameters. The value of the depth in the camera frame is also computed thanks to the coordinates in the camera frame which are stored in vpPoint.
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.
|
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 and in the image plan to set the visual feature parameters. The value of the depth 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 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 using the noisy camera parameters wrongCam. These last parameters are stored in the vpFeaturePoint.
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.
|
static |
Initialize a segment feature out of vpDots and camera 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().
|
static |
Initialize a segment feature out of vpDots and camera 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().
|
static |
Initialize a segment feature out of image points and camera 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().
|
static |
Build a segment visual feature from two points.
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().
|
static |
Initialize a point feature with polar coordinates 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 coordinates in meter in the camera frame and than in polar coordinates by:
s | : Visual feature to initialize. Be aware, the 3D depth 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 , and lastly we set the 3D depth of the point which is generally the result of a pose estimation.
Definition at line 102 of file vpFeatureBuilderPointPolar.cpp.
References vpPixelMeterConversion::convertPoint(), vpDot::getCog(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_theta(), and vpERROR_TRACE.
|
static |
Initialize a point feature with polar coordinates 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 coordinates in meter in the camera frame and than in polar coordinates by:
s | : Visual feature to initialize. Be aware, the 3D depth 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 , and lastly we set the 3D depth of the point which is generally the result of a pose estimation.
Definition at line 174 of file vpFeatureBuilderPointPolar.cpp.
References vpPixelMeterConversion::convertPoint(), vpDot2::getCog(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_theta(), and vpERROR_TRACE.
|
static |
Initialize a point feature with polar coordinates 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 coordinates in meter in the camera frame and than in polar coordinates by:
s | : Visual feature to initialize. Be aware, the 3D depth 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 , and lastly we set the 3D depth of the point which is generally the result of a pose estimation.
Definition at line 245 of file vpFeatureBuilderPointPolar.cpp.
References vpPixelMeterConversion::convertPoint(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_theta(), and vpERROR_TRACE.
|
static |
Initialize a point feature with polar coordinates using the coordinates of the point , where correspond to the perspective projection of the point in the image plane and the 3D depth of the point in the camera frame. The values of are expressed in meters. From the coordinates in the image plane, the polar coordinates are computed by:
s | : Visual feature and to initialize. |
p | : A point with cartesian coordinates in the image plane corresponding to the camera perspective projection, and with 3D depth . |
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.
|
static |
Initialize a point feature with polar coordinates using the coordinates of the point , where correspond to the perspective projection of the point in the image plane and the 3D depth of the point in the camera frame. The values of are expressed in meters.
This function intends to introduce noise in the conversion from cartesian to polar coordinates. Cartesian 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 using the noisy camera parameters wrongCam. From these new coordinates in the image plane, the polar coordinates are computed by:
s | : Visual feature and 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 cartesian coordinates in the image plane corresponding to the camera perspective projection, and with 3D depth . |
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.
|
static |
Initialize a 3D point feature using the coordinates of the point in the camera frame. The values of are expressed in meters.
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.
|
static |
Initialize a line feature thanks to a vpLine. A vpFeatureLine contains the parameters which are expressed in meter. It also contains the parameters of a plan equation . In vpLine there are the parameters of two plans, but the one which have the biggest D parameter is copied in the vpFeatureLine 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.
|
static |
Initialize a line feature thanks to a vpCylinder. A vpFeatureLine contains the parameters which are expressed in meter. It also contains the parameters of a plan equation . 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.
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.
|
static |
Initialize a line feature thanks to a vpMeLine and the parameters of the camera. A vpFeatureLine contains the parameters which are expressed in meter. In vpMeLine these parameters are given in pixel. The conversion is done thanks to the camera 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 , and lastly we set the parameters of the plane which is generally the result of a pose estimation.
Definition at line 194 of file vpFeatureBuilderLine.cpp.
References vpFeatureLine::buildFrom(), vpPixelMeterConversion::convertLine(), vpMeLine::getRho(), vpMeLine::getTheta(), and vpERROR_TRACE.
|
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 plan. All the parameters are given in meter.
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, vpFeatureEllipse::setABC(), and vpERROR_TRACE.
|
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.
s | : Visual feature to initialize. |
t | : The vpSphere used to create the vpFeatureEllipse. |
Definition at line 107 of file vpFeatureBuilderEllipse.cpp.
References vpFeatureEllipse::buildFrom(), vpTracker::cP, vpTracker::p, vpFeatureEllipse::setABC(), vpMath::sqr(), and vpERROR_TRACE.
|
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.
s | : Visual feature to initialize. |
cam | : The parameters of the camera used to acquire the image containing the vpDot. |
t | : The vpDot used to create the vpFeatureEllipse. |
Definition at line 152 of file vpFeatureBuilderEllipse.cpp.
References vpFeatureEllipse::buildFrom(), vpPixelMeterConversion::convertMoment(), vpDot::m00, vpDot::m01, vpDot::m02, vpDot::m10, vpDot::m11, vpDot::m20, vpMath::sqr(), and vpERROR_TRACE.
|
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.
s | : Visual feature to initialize. |
cam | : The parameters of the camera used to acquire the image containing the vpDot2. |
t | : The vpDot2 used to create the vpFeatureEllipse. |
Definition at line 209 of file vpFeatureBuilderEllipse.cpp.
References vpFeatureEllipse::buildFrom(), vpPixelMeterConversion::convertMoment(), vpDot2::m00, vpDot2::m01, vpDot2::m02, vpDot2::m10, vpDot2::m11, vpDot2::m20, vpMath::sqr(), and vpERROR_TRACE.
|
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 meter.
s | : Visual feature to initialize. |
cam | : The parameters of the camera used to acquire the image containing the vpDot2. |
t | : The vpMeEllipse used to create the vpFeatureEllipse. |
Definition at line 268 of file vpFeatureBuilderEllipse.cpp.
References vpFeatureEllipse::buildFrom(), vpPixelMeterConversion::convertMoment(), vpMeEllipse::get_m00(), vpMeEllipse::get_m01(), vpMeEllipse::get_m02(), vpMeEllipse::get_m10(), vpMeEllipse::get_m11(), vpMeEllipse::get_m20(), vpMath::sqr(), and vpERROR_TRACE.
|
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.
s | : Visual feature to initialize; either or either depending on select parameter. |
p | : The vpPoint with updated coordinates in the image plane that are used to create the vpFeatureVanishingPoint. |
select | : Use either vpFeatureVanishingPoint::selectX() or vpFeatureVanishingPoint::selectY() to build visual feature, or use rather select vpFeatureVanishingPoint::selectOneOverRho() or vpFeatureVanishingPoint::selectAlpha() to build 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().
|
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.
s | : Visual feature to initialize; either or rather depending on select parameter. |
L1 | : The first vpFeatureLine. |
L2 | : The second vpFeatureLine. |
select | : Use either vpFeatureVanishingPoint::selectX() or vpFeatureVanishingPoint::selectY() to build visual feature, or use rather select vpFeatureVanishingPoint::selectOneOverRho() or vpFeatureVanishingPoint::selectAlpha() to build visual feature. |
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.
|
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.
s | : Visual feature to initialize; either or rather depending on select parameter. |
L1 | : The first vpLine. |
L2 | : The second vpLine. |
select | : Use either vpFeatureVanishingPoint::selectX() or vpFeatureVanishingPoint::selectY() to build visual feature, or use rather select vpFeatureVanishingPoint::selectOneOverRho() or vpFeatureVanishingPoint::selectAlpha() to build visual feature. |
Definition at line 163 of file vpFeatureBuilderVanishingPoint.cpp.
References create().
|
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.
s | : Visual feature to initialize; either or rather 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 visual feature, or use rather select vpFeatureVanishingPoint::selectOneOverRho() or vpFeatureVanishingPoint::selectAlpha() to build 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().