ViSP
2.10.0
|
#include <vpGenericFeature.h>
Public Types | |
enum | vpBasicFeatureDeallocatorType { user, vpServo } |
Public Member Functions | |
void | init () |
vpGenericFeature (unsigned int dim) | |
virtual | ~vpGenericFeature () |
vpMatrix | interaction (const unsigned int select=FEATURE_ALL) |
vpColVector | error (const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL) |
vpColVector | error (const unsigned int select=FEATURE_ALL) |
void | print (const unsigned int select=FEATURE_ALL) const |
vpGenericFeature * | duplicate () const |
void | setInteractionMatrix (const vpMatrix &L) |
vpMatrix | getInteractionMatrix () const |
void | setError (const vpColVector &error_vector) |
void | set_s (const vpColVector &s) |
void | set_s (const double s0) |
void | set_s (const double s0, const double s1) |
void | set_s (const double s0, const double s1, const double s2) |
void | get_s (vpColVector &s) const |
void | get_s (double &s0) const |
void | get_s (double &s0, double &s1) const |
void | get_s (double &s0, double &s1, double &s2) 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 () |
Static Public Member Functions | |
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 enables to define a feature or a set of features which are not implemented in ViSP as a specific class. It is indeed possible to create its own features, to use the corresponding interaction matrix, and to compute an error between the current and the desired feature. Moreover the created features can be mixed with features already implemented.
The following example shows how to use the vpGenericFeature class to create and use the feature where Z corresponds to the depth of a point whose 2D coordinates in the camera frame are and . The interaction matrix corresponding to this feature is
.
The second example shows how to create and use a feature whose specificity is to have a desired feature fixed to zero. It is the case for the feature .
If the feature needs to be use with other features, the example servoSimuPoint2DhalfCamVelocity2.cpp shows how to do it.
Definition at line 176 of file vpGenericFeature.h.
|
inherited |
Indicates who should deallocate the feature.
Enumerator | |
---|---|
user | |
vpServo |
Definition at line 154 of file vpBasicFeature.h.
vpGenericFeature::vpGenericFeature | ( | unsigned int | dimension_gen_s | ) |
Constructor of the class you have to use. The feature table is initilialized with the good dimension.
dimension_gen_s | : Dimension of the generic feature. It corresponds to the number of features you want to create. |
Definition at line 102 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpColVector::resize(), and vpBasicFeature::s.
|
virtual |
Definition at line 62 of file vpGenericFeature.cpp.
|
inlineinherited |
Return the dimension of the feature vector .
Definition at line 102 of file vpBasicFeature.h.
|
virtual |
Not implemented.
Implements vpBasicFeature.
Definition at line 738 of file vpGenericFeature.cpp.
References vpERROR_TRACE.
|
virtual |
Not implemented.
Implements vpBasicFeature.
Definition at line 757 of file vpGenericFeature.cpp.
References vpERROR_TRACE.
|
virtual |
Implements vpBasicFeature.
Definition at line 726 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, and vpTRACE.
|
virtual |
Compute the error between the current and the desired visual features from a subset of the possible features.
if | errorHasBeenInitialized is true (that is if vpGenericFeature::setError have been used) then s_star is useless. In that since the error HAS TO BE recomputed at each iteration errorHasBeenInitialized is set to errHasToBeUpdated if vpGenericFeature::serError is not used in the loop then an exception is thrown |
obviously if vpGenericFeature::setError is not used then s_star is considered and this warning is meaningless.
s_star | : Desired visual feature. |
select | : The error can be computed for a selection of a subset of the possible features.
|
The code below shows how to use this method to manipulate the two visual features over three:
Reimplemented from vpBasicFeature.
Definition at line 191 of file vpGenericFeature.cpp.
References vpFeatureException::badErrorVectorError, vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpBasicFeature::get_s(), vpMatrix::getRows(), vpBasicFeature::s, vpFeatureException::sizeMismatchError, vpMatrix::stackMatrices(), vpDEBUG_TRACE, and vpERROR_TRACE.
vpColVector vpGenericFeature::error | ( | const unsigned int | select = FEATURE_ALL | ) |
Compute the error between the current and the desired visual features from a subset of the possible features. But in this case the desired feature is considered as set to 0.
select | : The error can be computed for a selection of a subset of the possible features.
|
The code below shows how to use this method to manipulate the two visual features over three:
Definition at line 304 of file vpGenericFeature.cpp.
References vpFeatureException::badErrorVectorError, vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpBasicFeature::s, vpMatrix::stackMatrices(), and vpERROR_TRACE.
|
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(), error(), vpFeatureDepth::error(), vpFeatureThetaU::error(), and vpFeatureTranslation::error().
void vpGenericFeature::get_s | ( | vpColVector & | s_vector | ) | const |
get the value of all the features.
s_vector | : It is a vector which will contain the value of the visual features. |
an | exception is thrown if the number of row of the vector s is different from the dimension of the visual feature as specified in the constructor |
Definition at line 509 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpMatrix::getRows(), vpBasicFeature::s, vpFeatureException::sizeMismatchError, and vpERROR_TRACE.
void vpGenericFeature::get_s | ( | double & | s0 | ) | const |
get the value of one feature if the number of feature is equal to 1.
s0 | : value of the visual feature |
an | exception is thrown if the number of row of the vector s is different from the dimension of the visual feature as specified in the constructor |
Definition at line 675 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::s, vpFeatureException::sizeMismatchError, and vpERROR_TRACE.
void vpGenericFeature::get_s | ( | double & | s0, |
double & | s1 | ||
) | const |
get the value of two features if the number of feature is equal to 2.
s0 | : value of the first visual feature |
s1 | : value of the second visual feature |
an | exception is thrown if the number of row of the vector s is different from the dimension of the visual feature as specified in the constructor |
Definition at line 623 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::s, vpFeatureException::sizeMismatchError, and vpERROR_TRACE.
void vpGenericFeature::get_s | ( | double & | s0, |
double & | s1, | ||
double & | s2 | ||
) | const |
get the value of three features if the number of feature is equal to 3.
s0 | : value of the first visual feature |
s1 | : value of the second visual feature |
s2 | : value of the third visual feature |
an | exception is thrown if the number of row of the vector s is different from the dimension of the visual feature as specified in the constructor |
Definition at line 567 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::s, vpFeatureException::sizeMismatchError, and vpERROR_TRACE.
|
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.
|
inline |
Definition at line 211 of file vpGenericFeature.h.
|
virtual |
Implements vpBasicFeature.
Definition at line 67 of file vpGenericFeature.cpp.
References vpBasicFeature::s.
|
virtual |
Compute and return the interaction matrix for the whole features or a part of them.
select | : Selection of a subset of the possible features.
|
The code below shows how to compute the interaction matrix associated to the first visual feature.
The code below shows how to compute the interaction matrix associated to two visual features over three.
Implements vpBasicFeature.
Definition at line 414 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpMatrix::getRows(), vpFeatureException::notInitializedError, vpMatrix::resize(), vpMatrix::stackMatrices(), and vpERROR_TRACE.
|
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 features.
|
Implements vpBasicFeature.
Definition at line 713 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, and vpBasicFeature::s.
|
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(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), and vpFeatureTranslation::interaction().
|
inlinestaticinherited |
Select all the features.
Definition at line 116 of file vpBasicFeature.h.
void vpGenericFeature::set_s | ( | const vpColVector & | s_vector | ) |
set the value of all the features.
s_vector | : It is a vector containing the value of the visual features. |
an | exception is thrown if the number of row of the vector s is different from the dimension of the visual feature as specified in the constructor |
Definition at line 484 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpMatrix::getRows(), vpBasicFeature::s, vpFeatureException::sizeMismatchError, and vpERROR_TRACE.
void vpGenericFeature::set_s | ( | const double | s0 | ) |
set the value of one feature if the number of feature is equal to 1.
s0 | : value of the visual feature |
an | exception is thrown if the number of row of the vector s is different from the dimension of the visual feature as specified in the constructor |
Definition at line 649 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::s, vpFeatureException::sizeMismatchError, and vpERROR_TRACE.
void vpGenericFeature::set_s | ( | const double | s0, |
const double | s1 | ||
) |
set the value of two features if the number of feature is equal to 2.
s0 | : value of the first visual feature |
s1 | : value of the second visual feature |
an | exception is thrown if the number of row of the vector s is different from the dimension of the visual feature as specified in the constructor |
Definition at line 595 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::s, vpFeatureException::sizeMismatchError, and vpERROR_TRACE.
void vpGenericFeature::set_s | ( | const double | s0, |
const double | s1, | ||
const double | s2 | ||
) |
set the value of three features if the number of feature is equal to 3.
s0 | : value of the first visual feature |
s1 | : value of the second visual feature |
s2 | : value of the third visual feature |
an | exception is thrown if the number of row of the vector s is different from the dimension of the visual feature as specified in the constructor |
Definition at line 537 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::s, vpFeatureException::sizeMismatchError, and vpERROR_TRACE.
|
inlineinherited |
Definition at line 163 of file vpBasicFeature.h.
Referenced by vpServo::addFeature().
void vpGenericFeature::setError | ( | const vpColVector & | error_vector | ) |
Set the error vector .
error_vector | : Error vector . |
vpFeatureException::sizeMismatchError | : If the size of the error vector is bad. |
Definition at line 119 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpMatrix::getRows(), vpFeatureException::sizeMismatchError, and vpERROR_TRACE.
|
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.
void vpGenericFeature::setInteractionMatrix | ( | const vpMatrix & | L_ | ) |
set the value of the interaction matrix.
L_ | : The matrix corresponding to the interaction matrix you computed. |
an | exception is thrown if the number of row of the interaction matrix is different from the dimension of the visual feature as specified in the constructor |
Definition at line 459 of file vpGenericFeature.cpp.
References vpBasicFeature::dim_s, vpMatrix::getRows(), vpFeatureException::sizeMismatchError, and vpERROR_TRACE.
|
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(), vpFeaturePointPolar::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(), duplicate(), vpBasicFeature::error(), vpFeatureLuminance::error(), error(), vpBasicFeature::get_s(), 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(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureLuminance::interaction(), interaction(), vpFeatureMoment::interaction(), vpBasicFeature::operator=(), vpFeatureLuminance::operator=(), print(), vpFeatureMoment::print(), set_s(), setError(), setInteractionMatrix(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and 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(), error(), vpBasicFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), interaction(), vpFeatureMoment::interaction(), 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(), vpFeaturePointPolar::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(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::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(), 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(), vpFeaturePointPolar::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(), vpFeaturePointPolar::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::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(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureEllipse::display(), vpFeatureMoment::duplicate(), vpBasicFeature::error(), vpFeatureEllipse::error(), vpFeatureVanishingPoint::error(), vpFeatureLuminance::error(), vpFeatureMomentAlpha::error(), error(), vpFeatureDepth::error(), vpFeaturePoint::error(), vpFeatureLine::error(), vpFeaturePoint3D::error(), vpFeaturePointPolar::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpFeatureDepth::get_LogZoverZstar(), vpFeaturePointPolar::get_rho(), vpBasicFeature::get_s(), get_s(), vpFeaturePointPolar::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(), init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpFeatureEllipse::print(), vpFeatureSegment::print(), print(), vpFeatureMoment::print(), vpFeatureLine::print(), vpFeatureThetaU::print(), vpFeatureTranslation::print(), vpFeatureDepth::set_LogZoverZstar(), vpFeaturePointPolar::set_rho(), 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(), 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().