![]() |
Visual Servoing Platform version 3.6.0
|
#include <vpFeaturePoint.h>
Public Types | |
enum | { FEATURE_ALL = 0xffff } |
enum | vpBasicFeatureDeallocatorType { user , vpServo } |
Deprecated functions | |
enum | vpFeaturePointType { X = 1 , Y = 2 } |
Public Member Functions | |
vpFeaturePoint () | |
virtual | ~vpFeaturePoint () |
void | buildFrom (double x, double y, double Z) |
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 |
vpFeaturePoint * | duplicate () const |
vpColVector | error (const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) |
double | get_x () const |
double | get_y () const |
double | get_Z () const |
void | init () |
vpMatrix | interaction (unsigned int select=FEATURE_ALL) |
void | print (unsigned int select=FEATURE_ALL) const |
void | set_x (double x) |
void | set_y (double y) |
void | set_Z (double Z) |
void | set_xyZ (double x, double y, double Z) |
Static Public Member Functions | |
static unsigned int | selectX () |
static unsigned int | selectY () |
Static Public Attributes | |
static const unsigned int | FEATURE_LINE [32] |
Protected Attributes | |
vpColVector | s |
unsigned int | dim_s |
bool * | flags |
unsigned int | nbParameters |
Inherited functionalities from vpBasicFeature | |
unsigned int | dimension_s () |
vpColVector | get_s (unsigned int select=FEATURE_ALL) const |
vpBasicFeatureDeallocatorType | getDeallocate () |
unsigned int | getDimension (unsigned int select=FEATURE_ALL) const |
virtual double | operator[] (unsigned int i) const |
void | setDeallocate (vpBasicFeatureDeallocatorType d) |
void | setFlags () |
static unsigned int | selectAll () |
vpBasicFeatureDeallocatorType | deallocate |
void | resetFlags () |
Class that defines a 2D point visual feature
In this class
The visual features can be set easily from an instance of the classes vpPoint, vpDot or vpDot2. For more precision see the vpFeatureBuilder class.
Once the values of the visual features are set, the interaction() method allows to compute the interaction matrix
The code below shows how to create a eye-in hand visual servoing task using a 2D point feature
If you want to build your own control law, this other example shows how to create a current (
An other fully explained example is given in the Tutorial: Image-based visual servo.
Definition at line 178 of file vpFeaturePoint.h.
|
inherited |
Enumerator | |
---|---|
FEATURE_ALL |
Definition at line 81 of file vpBasicFeature.h.
|
inherited |
Indicates who should deallocate the feature.
Enumerator | |
---|---|
user | |
vpServo |
Definition at line 87 of file vpBasicFeature.h.
Enumerator | |
---|---|
X | |
Y |
Definition at line 227 of file vpFeaturePoint.h.
vpFeaturePoint::vpFeaturePoint | ( | ) |
Default constructor that build a visual feature.
Definition at line 86 of file vpFeaturePoint.cpp.
References init().
Referenced by duplicate().
|
inlinevirtual |
Destructor.
Definition at line 188 of file vpFeaturePoint.h.
void vpFeaturePoint::buildFrom | ( | double | x_, |
double | y_, | ||
double | Z_ | ||
) |
Build a 2D point visual feature from the point coordinates in the image plan
See the vpFeaturePoint class description for more details about
x_ | : The ![]() |
y_ | : The ![]() |
Z_ | : The ![]() |
Definition at line 392 of file vpFeaturePoint.cpp.
References vpFeatureException::badInitializationError, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpBasicFeature::s, and vpERROR_TRACE.
|
inlineinherited |
Return the dimension of the feature vector
Definition at line 109 of file vpBasicFeature.h.
|
virtual |
Display 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 428 of file vpFeaturePoint.cpp.
References vpFeatureDisplay::displayPoint(), get_x(), get_y(), and vpERROR_TRACE.
|
virtual |
Display 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 454 of file vpFeaturePoint.cpp.
References vpFeatureDisplay::displayPoint(), get_x(), get_y(), and vpERROR_TRACE.
|
virtual |
Create an object with the same type.
Implements vpBasicFeature.
Definition at line 480 of file vpFeaturePoint.cpp.
References vpFeaturePoint().
|
virtual |
Compute the error
s_star | : Desired visual feature. |
select | : The error can be computed for a selection of a subset of the possible point features.
|
The code below shows how to use this method to manipulate the
Reimplemented from vpBasicFeature.
Definition at line 326 of file vpFeaturePoint.cpp.
References vpBasicFeature::s, selectX(), selectY(), and vpColVector::stack().
|
inherited |
Get the feature vector
Definition at line 112 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpBasicFeature::s, and vpColVector::stack().
Referenced by vpServo::computeError(), vpBasicFeature::error(), vpFeatureDepth::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), and vpGenericFeature::error().
double vpFeaturePoint::get_x | ( | ) | const |
Get the value of
Definition at line 127 of file vpFeaturePoint.cpp.
References vpBasicFeature::s.
Referenced by display(), display(), interaction(), and print().
double vpFeaturePoint::get_y | ( | ) | const |
Get the value of
Definition at line 147 of file vpFeaturePoint.cpp.
References vpBasicFeature::s.
Referenced by display(), display(), interaction(), and print().
double vpFeaturePoint::get_Z | ( | ) | const |
Get the value of
Definition at line 106 of file vpFeaturePoint.cpp.
Referenced by vpFeatureBuilder::create(), interaction(), and print().
|
inlineinherited |
Definition at line 122 of file vpBasicFeature.h.
|
inherited |
Get the feature vector dimension.
Definition at line 99 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpArray2D< Type >::getRows(), and vpBasicFeature::s.
|
virtual |
Initialize the memory space requested for 2D point visual feature.
Implements vpBasicFeature.
Definition at line 66 of file vpFeaturePoint.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpColVector::resize(), and vpBasicFeature::s.
Referenced by vpFeaturePoint().
|
virtual |
Compute and return the interaction matrix
select | : Selection of a subset of the possible point features.
|
The code below shows how to compute the interaction matrix associated to the visual feature
The code below shows how to compute the interaction matrix associated to the visual feature
Implements vpBasicFeature.
Definition at line 212 of file vpFeaturePoint.cpp.
References vpFeatureException::badInitializationError, vpBasicFeature::deallocate, vpBasicFeature::flags, get_x(), get_y(), get_Z(), vpBasicFeature::nbParameters, vpBasicFeature::resetFlags(), selectX(), selectY(), vpMatrix::stack(), vpBasicFeature::user, vpERROR_TRACE, and vpTRACE.
|
inlinevirtualinherited |
Return element i in the state vector (usage : x = s[i] )
Definition at line 129 of file vpBasicFeature.h.
|
virtual |
Print to stdout the values of the current visual feature
select | : Selection of a subset of the possible point features.
|
Implements vpBasicFeature.
Definition at line 369 of file vpFeaturePoint.cpp.
References get_x(), get_y(), get_Z(), selectX(), and selectY().
|
protectedinherited |
Definition at line 129 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
Referenced by vpFeatureVanishingPoint::interaction(), vpFeatureDepth::interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), and vpFeatureTranslation::interaction().
|
inlinestaticinherited |
Select all the features.
Definition at line 141 of file vpBasicFeature.h.
|
static |
Function used to select the
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to
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 504 of file vpFeaturePoint.cpp.
References vpBasicFeature::FEATURE_LINE.
Referenced by error(), interaction(), and print().
|
static |
Function used to select the
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to
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 524 of file vpFeaturePoint.cpp.
References vpBasicFeature::FEATURE_LINE.
Referenced by error(), interaction(), and print().
void vpFeaturePoint::set_x | ( | double | x | ) |
Set the value of
x | : ![]() |
Definition at line 115 of file vpFeaturePoint.cpp.
References vpBasicFeature::flags, and vpBasicFeature::s.
Referenced by vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), and set_xyZ().
void vpFeaturePoint::set_xyZ | ( | double | x_, |
double | y_, | ||
double | Z_ | ||
) |
Set the value of
x_ | : ![]() |
y_ | : ![]() |
Z_ | : ![]() |
Definition at line 160 of file vpFeaturePoint.cpp.
References vpBasicFeature::flags, vpBasicFeature::nbParameters, set_x(), set_y(), and set_Z().
void vpFeaturePoint::set_y | ( | double | y | ) |
Set the value of
y | : ![]() |
Definition at line 135 of file vpFeaturePoint.cpp.
References vpBasicFeature::flags, and vpBasicFeature::s.
Referenced by vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), and set_xyZ().
void vpFeaturePoint::set_Z | ( | double | Z_ | ) |
Set the value of
Z_ | : ![]() |
Definition at line 94 of file vpFeaturePoint.cpp.
References vpBasicFeature::flags.
Referenced by vpFeatureBuilder::create(), vpFeatureBuilder::create(), and set_xyZ().
|
inlineinherited |
Definition at line 136 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 139 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
|
protectedinherited |
Definition at line 147 of file vpBasicFeature.h.
Referenced by vpFeatureVanishingPoint::interaction(), vpFeatureDepth::interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureSegment::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(), vpGenericFeature::error(), vpFeatureLuminance::error(), vpGenericFeature::error(), vpGenericFeature::get_s(), vpGenericFeature::get_s(), vpGenericFeature::get_s(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureMoment::init(), vpFeatureMoment::interaction(), vpGenericFeature::interaction(), vpFeatureLuminance::interaction(), vpBasicFeature::operator=(), vpFeatureLuminance::operator=(), vpFeatureMoment::print(), vpGenericFeature::print(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpGenericFeature::setError(), vpGenericFeature::setInteractionMatrix(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpGenericFeature::vpGenericFeature().
|
staticinherited |
Definition at line 41 of file vpBasicFeature.h.
Referenced by vpBasicFeature::error(), vpGenericFeature::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpFeatureMoment::interaction(), vpGenericFeature::interaction(), vpFeatureMoment::print(), vpGenericFeature::print(), vpFeatureEllipse::select_n02(), vpFeatureEllipse::select_n11(), vpFeatureEllipse::select_n20(), vpFeatureSegment::selectAlpha(), vpFeatureVanishingPoint::selectAlpha(), vpFeatureVanishingPoint::selectAtanOneOverRho(), vpFeatureSegment::selectL(), vpFeatureEllipse::selectMu02(), vpFeatureEllipse::selectMu11(), vpFeatureEllipse::selectMu20(), vpFeatureVanishingPoint::selectOneOverRho(), vpFeatureLine::selectRho(), vpFeaturePointPolar::selectRho(), vpFeatureLine::selectTheta(), vpFeaturePointPolar::selectTheta(), vpFeatureThetaU::selectTUx(), vpFeatureThetaU::selectTUy(), vpFeatureThetaU::selectTUz(), vpFeatureTranslation::selectTx(), vpFeatureTranslation::selectTy(), vpFeatureTranslation::selectTz(), vpFeatureEllipse::selectX(), selectX(), vpFeaturePoint3D::selectX(), vpFeatureVanishingPoint::selectX(), vpFeatureSegment::selectXc(), vpFeatureEllipse::selectY(), selectY(), vpFeaturePoint3D::selectY(), vpFeatureVanishingPoint::selectY(), vpFeatureSegment::selectYc(), and vpFeaturePoint3D::selectZ().
|
protectedinherited |
Ensure that all the parameters needed to compute the iteraction matrix are set.
Definition at line 97 of file vpBasicFeature.h.
Referenced by vpFeatureTranslation::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureLine::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeatureEllipse::buildFrom(), buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureDepth::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeatureLuminance::init(), init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), vpFeatureMoment::init(), vpFeatureVanishingPoint::interaction(), vpFeatureDepth::interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureSegment::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_rhoThetaZ(), vpFeaturePointPolar::set_theta(), vpFeatureThetaU::set_TUx(), vpFeatureThetaU::set_TUy(), vpFeatureThetaU::set_TUz(), vpFeatureDepth::set_x(), vpFeatureEllipse::set_x(), set_x(), vpFeaturePoint3D::set_X(), vpFeatureVanishingPoint::set_x(), vpFeatureEllipse::set_xy(), set_xyZ(), vpFeaturePoint3D::set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureDepth::set_y(), vpFeatureEllipse::set_y(), set_y(), vpFeaturePoint3D::set_Y(), vpFeatureVanishingPoint::set_y(), vpFeatureDepth::set_Z(), vpFeatureLuminance::set_Z(), set_Z(), vpFeaturePoint3D::set_Z(), vpFeaturePointPolar::set_Z(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), vpBasicFeature::setFlags(), vpFeatureEllipse::setMoments(), vpFeatureVanishingPoint::setOneOverRho(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpBasicFeature::~vpBasicFeature().
|
protectedinherited |
Number of parameters needed to compute the interaction matrix.
Definition at line 99 of file vpBasicFeature.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureEllipse::buildFrom(), buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureDepth::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeatureLuminance::init(), init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), vpFeatureMoment::init(), vpFeatureVanishingPoint::interaction(), vpFeatureDepth::interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureSegment::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::set_rhoThetaZ(), 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 vpFeatureTranslation::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureLine::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeatureEllipse::buildFrom(), buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureDepth::buildFrom(), vpFeatureLuminance::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureEllipse::display(), vpFeatureEllipse::display(), vpFeatureMoment::duplicate(), vpFeatureVanishingPoint::error(), vpBasicFeature::error(), vpFeatureDepth::error(), vpFeatureEllipse::error(), vpFeatureLine::error(), vpFeatureMomentAlpha::error(), error(), vpFeaturePoint3D::error(), vpFeaturePointPolar::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpGenericFeature::error(), vpFeatureLuminance::error(), vpGenericFeature::error(), vpFeatureDepth::get_LogZoverZstar(), vpFeaturePointPolar::get_rho(), vpGenericFeature::get_s(), vpGenericFeature::get_s(), vpGenericFeature::get_s(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), vpFeaturePointPolar::get_theta(), vpFeatureThetaU::get_TUx(), vpFeatureThetaU::get_TUy(), vpFeatureThetaU::get_TUz(), vpFeatureTranslation::get_Tx(), vpFeatureTranslation::get_Ty(), vpFeatureTranslation::get_Tz(), get_x(), vpFeaturePoint3D::get_X(), vpFeatureVanishingPoint::get_x(), get_y(), vpFeaturePoint3D::get_Y(), vpFeatureVanishingPoint::get_y(), vpFeaturePoint3D::get_Z(), vpFeatureVanishingPoint::getAlpha(), vpFeatureVanishingPoint::getAtanOneOverRho(), vpBasicFeature::getDimension(), vpFeatureVanishingPoint::getOneOverRho(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), vpGenericFeature::init(), vpFeatureLuminance::init(), vpFeatureMoment::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpFeatureEllipse::print(), vpFeatureLine::print(), vpFeatureMoment::print(), vpFeatureSegment::print(), vpFeatureThetaU::print(), vpFeatureTranslation::print(), vpGenericFeature::print(), vpFeatureDepth::set_LogZoverZstar(), vpFeaturePointPolar::set_rho(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpFeaturePointPolar::set_theta(), vpFeatureThetaU::set_TUx(), vpFeatureThetaU::set_TUy(), vpFeatureThetaU::set_TUz(), vpFeatureTranslation::set_Tx(), vpFeatureTranslation::set_Ty(), vpFeatureTranslation::set_Tz(), vpFeatureEllipse::set_x(), set_x(), vpFeaturePoint3D::set_X(), vpFeatureVanishingPoint::set_x(), vpFeatureEllipse::set_xy(), vpFeatureEllipse::set_y(), set_y(), vpFeaturePoint3D::set_Y(), vpFeatureVanishingPoint::set_y(), vpFeaturePoint3D::set_Z(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), vpFeatureEllipse::setMoments(), vpFeatureVanishingPoint::setOneOverRho(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), and vpGenericFeature::vpGenericFeature().