ViSP
2.10.0
|
#include <vpFeaturePointPolar.h>
Public Types | |
enum | vpBasicFeatureDeallocatorType { user, vpServo } |
Public Member Functions | |
void | init () |
vpFeaturePointPolar () | |
virtual | ~vpFeaturePointPolar () |
void | buildFrom (const double rho, const double theta, const double Z) |
void | set_rho (const double rho) |
void | set_theta (const double theta) |
void | set_Z (const double Z) |
void | set_rhoThetaZ (const double rho, const double theta, const double Z) |
double | get_rho () const |
double | get_theta () const |
double | get_Z () const |
vpMatrix | interaction (const unsigned int select=FEATURE_ALL) |
vpColVector | error (const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL) |
void | print (const unsigned int select=FEATURE_ALL) const |
vpFeaturePointPolar * | duplicate () const |
void | display (const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const |
void | display (const vpCameraParameters &cam, const vpImage< vpRGBa > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const |
unsigned int | dimension_s () |
virtual double | operator[] (const unsigned int i) const |
vpColVector | get_s (unsigned int select=FEATURE_ALL) const |
unsigned int | getDimension (const unsigned int select=FEATURE_ALL) const |
void | setFlags () |
void | setDeallocate (vpBasicFeatureDeallocatorType d) |
vpBasicFeatureDeallocatorType | getDeallocate () |
Deprecated functions | |
vpColVector | error (const unsigned int select=FEATURE_ALL) |
Static Public Member Functions | |
static unsigned int | selectRho () |
static unsigned int | selectTheta () |
static unsigned int | selectAll () |
Static Public Attributes | |
static const unsigned int | FEATURE_LINE [32] |
static const unsigned int | FEATURE_ALL = 0xffff |
Protected Member Functions | |
void | resetFlags () |
Protected Attributes | |
vpColVector | s |
unsigned int | dim_s |
bool * | flags |
unsigned int | nbParameters |
vpBasicFeatureDeallocatorType | deallocate |
Class that defines 2D image point visual feature with polar coordinates described in [8].
Let us denote the polar coordinates of an image point, with the radius of the feature point with respect to the optical center and the angle. From cartesian coordinates of a image point, polar coordinates are obtained by:
From polar coordinates, cartesian coordinates of the feature point can be obtained by:
This class is intended to manipulate the 2D image point visual feature in polar coordinates . The interaction matrix related to is given by:
where is the 3D depth of the considered point in the camera frame.
Two ways are allowed to initialize the feature.
The interaction() method allows to compute the interaction matrix associated to the visual feature, while the error() method computes the error vector between the current visual feature and the desired one.
The code below shows how to create a eye-in hand visual servoing task using four 2D point features with polar coordinates. First we create four current features (p var name in the code) and four desired (pd var name in the code) point features with polar coordinates, set the task to use the interaction matrix associated to the current feature and than compute the camera velocity . The current feature is updated in the while() loop, while is initialized at the beginning.
If you want to deal only with the subset feature from the 2D point feature set, you have just to modify the addFeature() call in the previous example by the following line. In that case, the dimension of is four.
If you want to build your own control law, this other example shows how to create a current ( ) and desired ( ) 2D point visual feature with polar coordinates, compute the corresponding error vector and finally build the interaction matrix .
Definition at line 266 of file vpFeaturePointPolar.h.
|
inherited |
Indicates who should deallocate the feature.
Enumerator | |
---|---|
user | |
vpServo |
Definition at line 154 of file vpBasicFeature.h.
vpFeaturePointPolar::vpFeaturePointPolar | ( | ) |
Default constructor that build a 2D point visual feature with polar coordinates and initialize it to .
The 3D depth of the point requested in the interaction matrix (see interaction()) is initialized to .
Definition at line 111 of file vpFeaturePointPolar.cpp.
References init().
Referenced by duplicate().
|
inlinevirtual |
Destructor. Does nothing.
Definition at line 279 of file vpFeaturePointPolar.h.
void vpFeaturePointPolar::buildFrom | ( | const double | rho, |
const double | theta, | ||
const double | Z_ | ||
) |
Build a 2D image point visual feature with polar coordinates.
rho,theta | : Polar coordinates of the image point. |
Z_ | : 3D depth of the point in the camera frame. |
vpFeatureException::badInitializationError | If the depth ( coordinate) is negative. That means that the 3D point is behind the camera which is not possible. |
vpFeatureException::badInitializationError | If the depth ( coordinate) is null. That means that the 3D point is on the camera which is not possible. |
Definition at line 526 of file vpFeaturePointPolar.cpp.
References vpFeatureException::badInitializationError, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpBasicFeature::s, and vpERROR_TRACE.
|
inlineinherited |
Return the dimension of the feature vector .
Definition at line 102 of file vpBasicFeature.h.
|
virtual |
Display image point feature.
cam | : Camera parameters. |
I | : Image. |
color | : Color to use for the display |
thickness | : Thickness of the feature representation. |
Implements vpBasicFeature.
Definition at line 568 of file vpFeaturePointPolar.cpp.
References vpFeatureDisplay::displayPoint(), get_rho(), get_theta(), and vpERROR_TRACE.
|
virtual |
Display image point feature.
cam | : Camera parameters. |
I | : color Image. |
color | : Color to use for the display |
thickness | : Thickness of the feature representation. |
Implements vpBasicFeature.
Definition at line 601 of file vpFeaturePointPolar.cpp.
References vpFeatureDisplay::displayPoint(), get_rho(), get_theta(), and vpERROR_TRACE.
|
virtual |
Create an object with the same type.
Implements vpBasicFeature.
Definition at line 635 of file vpFeaturePointPolar.cpp.
References vpFeaturePointPolar().
|
virtual |
Compute the error between the current and the desired visual features from a subset of the possible features.
For the angular component , we define the error as , where is modulo substraction.
s_star | : Desired 2D image point visual feature with polar coordinates. |
select | : The error can be computed for a selection of a subset of the possible 2D point polar coordinate features.
|
The code below shows how to use this method to manipulate the component.
Reimplemented from vpBasicFeature.
Definition at line 425 of file vpFeaturePointPolar.cpp.
References vpBasicFeature::s, selectRho(), selectTheta(), vpMatrix::stackMatrices(), and vpERROR_TRACE.
vpColVector vpFeaturePointPolar::error | ( | const unsigned int | select = FEATURE_ALL | ) |
compute the error between a visual features and zero
double vpFeaturePointPolar::get_rho | ( | ) | const |
Get the image point polar coordinate.
Definition at line 179 of file vpFeaturePointPolar.cpp.
References vpBasicFeature::s.
Referenced by display(), interaction(), and print().
|
inherited |
Get the feature vector .
Definition at line 135 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpBasicFeature::s, and vpMatrix::stackMatrices().
Referenced by vpServo::computeError(), vpBasicFeature::error(), vpGenericFeature::error(), vpFeatureDepth::error(), vpFeatureThetaU::error(), and vpFeatureTranslation::error().
double vpFeaturePointPolar::get_theta | ( | ) | const |
Get the image point polar coordinate.
Definition at line 190 of file vpFeaturePointPolar.cpp.
References vpBasicFeature::s.
Referenced by display(), interaction(), and print().
double vpFeaturePointPolar::get_Z | ( | ) | const |
Get the 3D point depth in the camera frame.
Definition at line 199 of file vpFeaturePointPolar.cpp.
Referenced by vpFeatureBuilder::create(), interaction(), and print().
|
inlineinherited |
Definition at line 164 of file vpBasicFeature.h.
|
inherited |
Get the feature vector dimension.
Definition at line 120 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpMatrix::getRows(), and vpBasicFeature::s.
|
virtual |
Initialise the memory space requested for a 2D point visual feature with polar coordinates.
By default this feature is initialized to . The 3D depth of the point requested in the interaction matrix (see interaction()) is initialized to .
Implements vpBasicFeature.
Definition at line 84 of file vpFeaturePointPolar.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpColVector::resize(), and vpBasicFeature::s.
Referenced by vpFeaturePointPolar().
|
virtual |
Compute and return the interaction matrix associated to a subset of the possible 2D image point features with polar coordinates .
where is the 3D depth of the considered point.
select | : Selection of a subset of the possible polar point coordinate features.
|
vpFeatureException::badInitializationError | : If the point is behind the camera , or if the 3D depth is null , or if the polar coordinate of the point is null. |
The code below shows how to compute the interaction matrix associated to the visual feature .
The interaction matrix could also be build by:
In both cases, L is a 2 by 6 matrix. The first line corresponds to the visual feature while the second one to the visual feature.
It is also possible to build the interaction matrix associated to one of the possible features. The code below shows how to consider only the component.
In that case, L_theta is a 1 by 6 matrix.
Implements vpBasicFeature.
Definition at line 282 of file vpFeaturePointPolar.cpp.
References vpFeatureException::badInitializationError, vpBasicFeature::deallocate, vpBasicFeature::flags, get_rho(), get_theta(), get_Z(), vpBasicFeature::nbParameters, vpBasicFeature::resetFlags(), vpMatrix::resize(), selectRho(), selectTheta(), vpMatrix::stackMatrices(), vpBasicFeature::user, vpERROR_TRACE, and vpTRACE.
|
inlinevirtualinherited |
Return element i in the state vector (usage : x = s[i] )
Definition at line 113 of file vpBasicFeature.h.
|
virtual |
Print to stdout the values of the current visual feature.
select | : Selection of a subset of the possible 2D image point feature coordinates.
|
Implements vpBasicFeature.
Definition at line 496 of file vpFeaturePointPolar.cpp.
References get_rho(), get_theta(), get_Z(), selectRho(), and selectTheta().
|
protectedinherited |
Definition at line 153 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
Referenced by vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), interaction(), vpFeatureThetaU::interaction(), and vpFeatureTranslation::interaction().
|
inlinestaticinherited |
Select all the features.
Definition at line 116 of file vpBasicFeature.h.
|
inlinestatic |
Function used to select the subset polar coordinate of the image point visual feature.
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to feature.
See the interaction() method for an usage example.
This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law:
Definition at line 330 of file vpFeaturePointPolar.h.
Referenced by error(), interaction(), and print().
|
inlinestatic |
Function used to select the subset polar coordinate of the image point visual feature.
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to feature.
See the interaction() method for an usage example.
This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law:
Definition at line 356 of file vpFeaturePointPolar.h.
Referenced by error(), interaction(), and print().
void vpFeaturePointPolar::set_rho | ( | const double | rho | ) |
Set the image point polar coordinate.
Definition at line 123 of file vpFeaturePointPolar.cpp.
References vpBasicFeature::flags, and vpBasicFeature::s.
Referenced by vpFeatureBuilder::create(), and set_rhoThetaZ().
void vpFeaturePointPolar::set_rhoThetaZ | ( | const double | rho, |
const double | theta, | ||
const double | Z_ | ||
) |
Initialize the image point visual feature with polar coordinates.
rho,theta | : Polar coordinates of the image point. |
Z_ | : 3D depth of the point in the camera frame. |
Definition at line 162 of file vpFeaturePointPolar.cpp.
References vpBasicFeature::flags, vpBasicFeature::nbParameters, set_rho(), set_theta(), and set_Z().
void vpFeaturePointPolar::set_theta | ( | const double | theta | ) |
Set the image point polar coordinate.
Definition at line 134 of file vpFeaturePointPolar.cpp.
References vpBasicFeature::flags, and vpBasicFeature::s.
Referenced by vpFeatureBuilder::create(), and set_rhoThetaZ().
void vpFeaturePointPolar::set_Z | ( | const double | Z_ | ) |
Set the 3D point depth in the camera frame.
Definition at line 145 of file vpFeaturePointPolar.cpp.
References vpBasicFeature::flags.
Referenced by vpFeatureBuilder::create(), and set_rhoThetaZ().
|
inlineinherited |
Definition at line 163 of file vpBasicFeature.h.
Referenced by vpServo::addFeature().
|
inherited |
Set feature flags to true to prevent warning when re-computing the interaction matrix without having updated the feature.
Definition at line 163 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
|
protectedinherited |
Definition at line 161 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), and vpBasicFeature::operator=().
|
protectedinherited |
Dimension of the visual feature.
Definition at line 93 of file vpBasicFeature.h.
Referenced by vpFeatureMoment::duplicate(), vpGenericFeature::duplicate(), vpBasicFeature::error(), vpFeatureLuminance::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), init(), vpFeatureTranslation::init(), vpFeatureLuminance::interaction(), vpGenericFeature::interaction(), vpFeatureMoment::interaction(), vpBasicFeature::operator=(), vpFeatureLuminance::operator=(), vpGenericFeature::print(), vpFeatureMoment::print(), vpGenericFeature::set_s(), vpGenericFeature::setError(), vpGenericFeature::setInteractionMatrix(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpGenericFeature::vpGenericFeature().
|
staticinherited |
Definition at line 87 of file vpBasicFeature.h.
Referenced by vpFeatureDepth::error(), vpFeatureDepth::interaction(), and vpFeatureDepth::print().
|
staticinherited |
Definition at line 85 of file vpBasicFeature.h.
Referenced by vpBasicFeature::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpGenericFeature::interaction(), vpFeatureMoment::interaction(), vpGenericFeature::print(), and vpFeatureMoment::print().
|
protectedinherited |
Ensure that all the parameters needed to compute the iteraction matrix are set.
Definition at line 96 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::buildFrom(), vpFeatureVanishingPoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), set_rho(), set_rhoThetaZ(), set_theta(), vpFeatureThetaU::set_TUx(), vpFeatureThetaU::set_TUy(), vpFeatureThetaU::set_TUz(), vpFeatureEllipse::set_x(), vpFeatureVanishingPoint::set_x(), vpFeatureDepth::set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureEllipse::set_xy(), vpFeaturePoint::set_xyZ(), vpFeaturePoint3D::set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureEllipse::set_y(), vpFeatureVanishingPoint::set_y(), vpFeatureDepth::set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeatureLuminance::set_Z(), vpFeatureDepth::set_Z(), vpFeaturePoint::set_Z(), vpFeaturePoint3D::set_Z(), set_Z(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpBasicFeature::setFlags(), vpFeatureEllipse::setMu(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpBasicFeature::~vpBasicFeature().
|
protectedinherited |
Number of parameters needed to compute the interaction matrix.
Definition at line 98 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::buildFrom(), vpFeatureVanishingPoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), set_rhoThetaZ(), vpFeaturePoint::set_xyZ(), vpFeaturePoint3D::set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpBasicFeature::setFlags(), vpFeatureMoment::update(), and vpFeatureLuminance::vpFeatureLuminance().
|
protectedinherited |
State of the visual feature.
Definition at line 91 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::buildFrom(), vpFeatureLuminance::buildFrom(), vpFeatureVanishingPoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureEllipse::display(), vpFeatureMoment::duplicate(), vpBasicFeature::error(), vpFeatureEllipse::error(), vpFeatureVanishingPoint::error(), vpFeatureLuminance::error(), vpFeatureMomentAlpha::error(), vpGenericFeature::error(), vpFeatureDepth::error(), vpFeaturePoint::error(), vpFeatureLine::error(), vpFeaturePoint3D::error(), error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpFeatureDepth::get_LogZoverZstar(), get_rho(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), get_theta(), vpFeatureThetaU::get_TUx(), vpFeatureThetaU::get_TUy(), vpFeatureThetaU::get_TUz(), vpFeatureTranslation::get_Tx(), vpFeatureTranslation::get_Ty(), vpFeatureTranslation::get_Tz(), vpFeatureVanishingPoint::get_x(), vpFeaturePoint::get_x(), vpFeaturePoint3D::get_X(), vpFeatureVanishingPoint::get_y(), vpFeaturePoint::get_y(), vpFeaturePoint3D::get_Y(), vpFeaturePoint3D::get_Z(), vpBasicFeature::getDimension(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpGenericFeature::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpFeatureEllipse::print(), vpFeatureSegment::print(), vpGenericFeature::print(), vpFeatureMoment::print(), vpFeatureLine::print(), vpFeatureThetaU::print(), vpFeatureTranslation::print(), vpFeatureDepth::set_LogZoverZstar(), set_rho(), vpGenericFeature::set_s(), set_theta(), vpFeatureThetaU::set_TUx(), vpFeatureThetaU::set_TUy(), vpFeatureThetaU::set_TUz(), vpFeatureTranslation::set_Tx(), vpFeatureTranslation::set_Ty(), vpFeatureTranslation::set_Tz(), vpFeatureEllipse::set_x(), vpFeatureVanishingPoint::set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureEllipse::set_xy(), vpFeatureEllipse::set_y(), vpFeatureVanishingPoint::set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeaturePoint3D::set_Z(), vpFeatureEllipse::setMu(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), and vpGenericFeature::vpGenericFeature().