ViSP
2.10.0
|
#include <vpFeatureDepth.h>
Public Types | |
enum | vpBasicFeatureDeallocatorType { user, vpServo } |
Public Member Functions | |
void | init () |
vpFeatureDepth () | |
virtual | ~vpFeatureDepth () |
void | buildFrom (const double x, const double y, const double Z, const double LogZoverZstar) |
void | set_x (const double x) |
void | set_y (const double y) |
void | set_Z (const double Z) |
void | set_LogZoverZstar (const double LogZoverZstar) |
void | set_xyZLogZoverZstar (const double x, const double y, const double Z, const double logZZs) |
double | get_x () const |
double | get_y () const |
double | get_Z () const |
double | get_LogZoverZstar () 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 |
vpFeatureDepth * | 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 | 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 a 3D point visual feature which is composed by one parameters that is that defines the current depth relative to the desired depth. Here represents the current depth and the desired depth.
In this class and are the 2D coordinates in the camera frame and are given in meter. , and are needed during the computation of the interaction matrix .
The visual features can be set easily thanks to the buildFrom() method.
As the visual feature represents the current depth relative to the desired depth, the desired visual feature is set to zero. Once the value of the visual feature is set, 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 which is here set to zero.
The code below shows how to create a eye-in hand visual servoing task using a 3D depth feature that corresponds to the current depth relative to the desired depth. To control six degrees of freedom, at least five other features must be considered. First we create a current ( ) 3D depth feature. Then we set the task to use the interaction matrix associated to the current feature . And finally we compute the camera velocity . The current feature is updated in the while() loop.
If you want to build your own control law, this other example shows how to create a current ( ) and desired ( ) 2D point visual feature, compute the corresponding error vector and finally build the interaction matrix .
Definition at line 166 of file vpFeatureDepth.h.
|
inherited |
Indicates who should deallocate the feature.
Enumerator | |
---|---|
user | |
vpServo |
Definition at line 154 of file vpBasicFeature.h.
vpFeatureDepth::vpFeatureDepth | ( | ) |
Default constructor that build a visual feature.
Definition at line 103 of file vpFeatureDepth.cpp.
References init().
Referenced by duplicate().
|
inlinevirtual |
Destructor.
Definition at line 181 of file vpFeatureDepth.h.
void vpFeatureDepth::buildFrom | ( | const double | x_, |
const double | y_, | ||
const double | Z_, | ||
const double | LogZoverZstar | ||
) |
Build a 3D depth visual feature from the point coordinates and given in the camera frame, which describes the depth and which represents the logarithm of the current depth relative to the desired depth.
x_ | : The parameter. |
y_ | : The parameter. |
Z_ | : The parameter. |
LogZoverZstar | : The parameter. |
Definition at line 414 of file vpFeatureDepth.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 469 of file vpFeatureDepth.cpp.
References vpERROR_TRACE.
|
virtual |
Not implemented.
Implements vpBasicFeature.
Definition at line 490 of file vpFeatureDepth.cpp.
References vpERROR_TRACE.
|
virtual |
Create an object with the same type.
Implements vpBasicFeature.
Definition at line 457 of file vpFeatureDepth.cpp.
References vpFeatureDepth().
|
virtual |
Compute the error between the current and the desired visual features from a subset of the possible features.
Since this visual feature represent the current depth relative to the desired depth, the desired visual feature should be zero. Thus, the error is here equal to the current visual feature .
s_star | : Desired visual visual feature that should be equal to zero. |
select | : unuseful in the case of vpFeatureDepth. Always set to FEATURE_ALL. |
vpFeatureException::badInitializationError | : If the desired visual feature is not equal to zero. |
The code below shows how to use this method:
Reimplemented from vpBasicFeature.
Definition at line 354 of file vpFeatureDepth.cpp.
References vpFeatureException::badInitializationError, vpBasicFeature::FEATURE_ALL, vpBasicFeature::get_s(), vpBasicFeature::s, vpMatrix::sumSquare(), and vpERROR_TRACE.
double vpFeatureDepth::get_LogZoverZstar | ( | ) | const |
Get the value of which represents the logarithm of the current depth relative to the desired depth.
Definition at line 127 of file vpFeatureDepth.cpp.
References vpBasicFeature::s.
Referenced by 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(), error(), vpFeatureThetaU::error(), and vpFeatureTranslation::error().
double vpFeatureDepth::get_x | ( | ) | const |
Get the value of which represents the x coordinate of the point in the camera frame.
Definition at line 152 of file vpFeatureDepth.cpp.
Referenced by interaction(), and print().
double vpFeatureDepth::get_y | ( | ) | const |
Get the value of which represents the y coordinate of the point in the camera frame.
Definition at line 177 of file vpFeatureDepth.cpp.
Referenced by interaction(), and print().
double vpFeatureDepth::get_Z | ( | ) | const |
Get the value of which represents the depth in the 3D camera frame.
Definition at line 201 of file vpFeatureDepth.cpp.
Referenced by 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 |
Initialize the memory space requested for 3D depth visual feature.
Implements vpBasicFeature.
Definition at line 84 of file vpFeatureDepth.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpColVector::resize(), and vpBasicFeature::s.
Referenced by vpFeatureDepth().
|
virtual |
Compute and return the interaction matrix . The computation is made thanks to the values of the point coordinates and and the depth .
select | : unuseful in the case of vpFeatureDepth. Always set to FEATURE_ALL. |
The code below shows how to compute the interaction matrix associated to the visual feature .
Implements vpBasicFeature.
Definition at line 251 of file vpFeatureDepth.cpp.
References vpFeatureException::badInitializationError, vpBasicFeature::deallocate, vpBasicFeature::FEATURE_ALL, vpBasicFeature::flags, get_x(), get_y(), get_Z(), vpBasicFeature::nbParameters, vpBasicFeature::resetFlags(), vpMatrix::resize(), 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 | : unuseful in the case of vpFeatureDepth. Always set to FEATURE_ALL. |
Implements vpBasicFeature.
Definition at line 390 of file vpFeatureDepth.cpp.
References vpBasicFeature::FEATURE_ALL, get_LogZoverZstar(), get_x(), get_y(), and get_Z().
|
protectedinherited |
Definition at line 153 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
Referenced by vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), 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 vpFeatureDepth::set_LogZoverZstar | ( | const double | LogZoverZstar | ) |
Set the value of which represents the logarithm of the current depth relative to the desired depth.
LogZoverZstar | : value to set. |
Definition at line 115 of file vpFeatureDepth.cpp.
References vpBasicFeature::s.
Referenced by set_xyZLogZoverZstar().
void vpFeatureDepth::set_x | ( | const double | x_ | ) |
Set the value of which represents the x coordinate of the point in the camera frame.
x_ | : value to set. |
Definition at line 139 of file vpFeatureDepth.cpp.
References vpBasicFeature::flags.
Referenced by set_xyZLogZoverZstar().
void vpFeatureDepth::set_xyZLogZoverZstar | ( | const double | x_, |
const double | y_, | ||
const double | Z_, | ||
const double | LogZoverZstar | ||
) |
Set the value of , , and . and represent the coordinates of the point in the camera frame. is the 3D coordinate representing the depth. represents the logarithm of the current depth relative to the desired depth.
x_ | : value to set. |
y_ | : value to set. |
Z_ | : value to set. |
LogZoverZstar | : value to set. |
Definition at line 216 of file vpFeatureDepth.cpp.
References vpBasicFeature::flags, vpBasicFeature::nbParameters, set_LogZoverZstar(), set_x(), set_y(), and set_Z().
void vpFeatureDepth::set_y | ( | const double | y_ | ) |
Set the value of which represents the y coordinate of the point in the camera frame.
y_ | : value to set. |
Definition at line 164 of file vpFeatureDepth.cpp.
References vpBasicFeature::flags.
Referenced by set_xyZLogZoverZstar().
void vpFeatureDepth::set_Z | ( | const double | Z_ | ) |
Set the value of which represents the depth in the 3D camera frame.
Z_ | : value to set. |
Definition at line 188 of file vpFeatureDepth.cpp.
References vpBasicFeature::flags.
Referenced by set_xyZLogZoverZstar().
|
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(), 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(), 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(), init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::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 error(), interaction(), and 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(), buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), 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(), set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureEllipse::set_xy(), vpFeaturePoint::set_xyZ(), vpFeaturePoint3D::set_XYZ(), set_xyZLogZoverZstar(), vpFeatureEllipse::set_y(), vpFeatureVanishingPoint::set_y(), set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeatureLuminance::set_Z(), 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(), buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), 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(), 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(), 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(), vpGenericFeature::error(), error(), vpFeaturePoint::error(), vpFeatureLine::error(), vpFeaturePoint3D::error(), vpFeaturePointPolar::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), 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(), 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(), init(), vpGenericFeature::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(), vpGenericFeature::print(), vpFeatureMoment::print(), vpFeatureLine::print(), vpFeatureThetaU::print(), vpFeatureTranslation::print(), 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(), 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().