ViSP
2.9.0
|
#include <vpFeaturePoint3D.h>
Public Types | |
enum | vpBasicFeatureDeallocatorType { user, vpServo } |
Public Member Functions | |
void | init () |
vpFeaturePoint3D () | |
virtual | ~vpFeaturePoint3D () |
void | buildFrom (const vpPoint &p) |
void | buildFrom (const double X, const double Y, const double Z) |
void | set_X (const double X) |
void | set_Y (const double Y) |
void | set_Z (const double Z) |
void | set_XYZ (const double X, const double Y, const double Z) |
double | get_X () const |
double | get_Y () 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 |
vpFeaturePoint3D * | 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 () |
Static Public Member Functions | |
static unsigned int | selectX () |
static unsigned int | selectY () |
static unsigned int | selectZ () |
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 the 3D point visual feature.
A 3D point visual feature corresponds to a 3D point with coordinates in the camera frame.
This class is intended to manipulate the 3D point visual feature . The interaction matrix related to is given by:
Two ways are allowed to initialize the feature.
The interaction() method allows to compute the interaction matrix associated to the 3D point 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 a 3D point feature that correspond to the 3D point coordinates in the camera frame. To control six degrees of freedom, at least three other features must be considered like vpFeatureThetaU visual features. First we create a current ( ) and desired ( ) 3D point feature, set the task to use the interaction matrix associated to the desired feature and than compute the camera velocity . The current feature is updated in the while() loop while is set to .
If you want to deal only with the subset feature from the 3D point feature, you have just to modify the addFeature() call in the previous example by the following line. In that case, the dimension of is two.
If you want to build your own control law, this other example shows how to create a current ( ) and desired ( ) 3D point visual feature, compute the corresponding error vector and finally build the interaction matrix .
Definition at line 216 of file vpFeaturePoint3D.h.
|
inherited |
Indicates who should deallocate the feature.
Enumerator | |
---|---|
user | |
vpServo |
Definition at line 154 of file vpBasicFeature.h.
vpFeaturePoint3D::vpFeaturePoint3D | ( | ) |
Default constructor that build a 3D point visual feature and initialize it to .
Definition at line 99 of file vpFeaturePoint3D.cpp.
References init().
Referenced by duplicate().
|
inlinevirtual |
Destructor. Does nothing.
Definition at line 226 of file vpFeaturePoint3D.h.
References vpBasicFeature::flags.
void vpFeaturePoint3D::buildFrom | ( | const vpPoint & | p | ) |
Build a 3D point visual feature from the camera frame coordinates of a point.
p | : A point with camera frame coordinates up to date (see vpPoint class). |
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 451 of file vpFeaturePoint3D.cpp.
References vpFeatureException::badInitializationError, vpTracker::cP, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpBasicFeature::s, and vpERROR_TRACE.
void vpFeaturePoint3D::buildFrom | ( | const double | X, |
const double | Y, | ||
const double | Z | ||
) |
Build a 3D point visual feature from the camera frame coordinates of a point.
X,Y,Z | : Camera frame coordinates of a 3D point. |
vpFeatureException::badInitializationError | If the depth ( coordinate) is negative. That means that the 3D point is on 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 500 of file vpFeaturePoint3D.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 |
Not implemented.
Implements vpBasicFeature.
Definition at line 590 of file vpFeaturePoint3D.cpp.
References vpERROR_TRACE.
|
virtual |
Not implemented.
Implements vpBasicFeature.
Definition at line 611 of file vpFeaturePoint3D.cpp.
References vpERROR_TRACE.
|
virtual |
Create an object with the same type.
Implements vpBasicFeature.
Definition at line 579 of file vpFeaturePoint3D.cpp.
References vpFeaturePoint3D().
|
virtual |
Compute the error between the current and the desired visual features from a subset of the possible features.
s_star | : Desired 3D point visual feature. |
select | : The error can be computed for a selection of a subset of the possible 3D point coordinate features.
|
The code below shows how to use this method to manipulate the subset:
To manipulate the subset features , the code becomes:
Reimplemented from vpBasicFeature.
Definition at line 389 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::s, selectX(), selectY(), selectZ(), vpMatrix::stackMatrices(), and vpERROR_TRACE.
|
inherited |
Get the feature vector .
Definition at line 123 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 vpFeaturePoint3D::get_X | ( | ) | const |
Return the coordinate in the camera frame of the 3D point.
Definition at line 175 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::s.
Referenced by interaction(), and print().
double vpFeaturePoint3D::get_Y | ( | ) | const |
Return the coordinate in the camera frame of the 3D point.
Definition at line 182 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::s.
Referenced by interaction(), and print().
double vpFeaturePoint3D::get_Z | ( | ) | const |
Return the coordinate in the camera frame of the 3D point.
Definition at line 189 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::s.
Referenced by interaction(), and print().
|
inlineinherited |
Definition at line 164 of file vpBasicFeature.h.
|
inherited |
Get the feature vector dimension.
Definition at line 108 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpMatrix::getRows(), and vpBasicFeature::s.
|
virtual |
Initialise the memory space requested for a 3D point visual feature.
By default this feature is initialized to .
Implements vpBasicFeature.
Definition at line 74 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpColVector::resize(), and vpBasicFeature::s.
Referenced by vpFeaturePoint3D().
|
virtual |
Compute and return the interaction matrix associated to a subset of the possible 3D point features that represent the 3D point coordinates expressed in the camera frame.
select | : Selection of a subset of the possible 3D point coordinate 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 subset visual feature:
L_XY is here now 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 from all the 3D point coordinates by:
In that case, L_XYZ is a 3 by 6 interaction matrix where the last line corresponds to the visual feature.
Implements vpBasicFeature.
Definition at line 262 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::deallocate, vpBasicFeature::flags, get_X(), get_Y(), get_Z(), vpBasicFeature::nbParameters, vpBasicFeature::resetFlags(), vpMatrix::resize(), selectX(), selectY(), selectZ(), vpMatrix::stackMatrices(), vpBasicFeature::user, 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 3D point feature coordinates.
|
Implements vpBasicFeature.
Definition at line 554 of file vpFeaturePoint3D.cpp.
References get_X(), get_Y(), get_Z(), selectX(), selectY(), and selectZ().
|
protectedinherited |
Definition at line 141 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
Referenced by vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), interaction(), vpFeaturePointPolar::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 coordinate of the 3D 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 282 of file vpFeaturePoint3D.h.
Referenced by error(), interaction(), and print().
|
inlinestatic |
Function used to select the subset coordinate of the 3D 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 308 of file vpFeaturePoint3D.h.
Referenced by error(), interaction(), and print().
|
inlinestatic |
Function used to select the subset coordinate of the 3D 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 334 of file vpFeaturePoint3D.h.
Referenced by error(), interaction(), and print().
void vpFeaturePoint3D::set_X | ( | const double | X | ) |
Initialise the coordinate in the camera frame of the 3D Point visual feature .
X | : coordinate of the visual feature. |
Definition at line 115 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::flags, and vpBasicFeature::s.
Referenced by vpFeatureBuilder::create(), and set_XYZ().
void vpFeaturePoint3D::set_XYZ | ( | const double | X, |
const double | Y, | ||
const double | Z | ||
) |
Initialize the 3D point coordinates.
X,Y,Z | : coordinates in the camera frame of the 3D point visual feature. |
Definition at line 162 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::flags, vpBasicFeature::nbParameters, set_X(), set_Y(), and set_Z().
void vpFeaturePoint3D::set_Y | ( | const double | Y | ) |
Initialise the coordinate in the camera frame of the 3D Point visual feature .
Y | : coordinate of the visual feature. |
Definition at line 131 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::flags, and vpBasicFeature::s.
Referenced by vpFeatureBuilder::create(), and set_XYZ().
void vpFeaturePoint3D::set_Z | ( | const double | Z | ) |
Initialise the coordinate in the camera frame of the 3D Point visual feature .
Z | : coordinate or depth of the visual feature. |
Definition at line 147 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::flags, and vpBasicFeature::s.
Referenced by vpFeatureBuilder::create(), and set_XYZ().
|
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 151 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(), 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(), 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(), init(), vpFeatureThetaU::init(), vpFeaturePointPolar::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(), 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(), init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), 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(), set_X(), vpFeatureEllipse::set_xy(), vpFeaturePoint::set_xyZ(), set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureEllipse::set_y(), vpFeatureVanishingPoint::set_y(), vpFeatureDepth::set_y(), vpFeaturePoint::set_y(), set_Y(), vpFeatureLuminance::set_Z(), vpFeatureDepth::set_Z(), vpFeaturePoint::set_Z(), set_Z(), vpFeaturePointPolar::set_Z(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpBasicFeature::setFlags(), vpFeatureEllipse::setMu(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), vpFeatureDepth::~vpFeatureDepth(), vpFeatureEllipse::~vpFeatureEllipse(), vpFeatureLine::~vpFeatureLine(), vpFeatureLuminance::~vpFeatureLuminance(), vpFeatureMoment::~vpFeatureMoment(), vpFeaturePoint::~vpFeaturePoint(), ~vpFeaturePoint3D(), vpFeaturePointPolar::~vpFeaturePointPolar(), vpFeatureSegment::~vpFeatureSegment(), vpFeatureThetaU::~vpFeatureThetaU(), vpFeatureTranslation::~vpFeatureTranslation(), and vpFeatureVanishingPoint::~vpFeatureVanishingPoint().
|
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(), buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), interaction(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::set_rhoThetaZ(), vpFeaturePoint::set_xyZ(), 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(), buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::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(), error(), vpFeaturePointPolar::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpFeatureDepth::get_LogZoverZstar(), vpFeaturePointPolar::get_rho(), 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(), vpFeatureVanishingPoint::get_x(), vpFeaturePoint::get_x(), get_X(), vpFeatureVanishingPoint::get_y(), vpFeaturePoint::get_y(), get_Y(), get_Z(), vpBasicFeature::getDimension(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpGenericFeature::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), init(), vpFeatureThetaU::init(), vpFeaturePointPolar::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(), vpFeaturePointPolar::set_rho(), 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(), vpFeatureVanishingPoint::set_x(), vpFeaturePoint::set_x(), set_X(), vpFeatureEllipse::set_xy(), vpFeatureEllipse::set_y(), vpFeatureVanishingPoint::set_y(), vpFeaturePoint::set_y(), set_Y(), set_Z(), vpFeatureEllipse::setMu(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), and vpGenericFeature::vpGenericFeature().