Visual Servoing Platform
version 3.6.1 under development (2024-10-10)
|
#include <visp3/visual_features/vpFeatureDepth.h>
Public Types | |
enum | vpBasicFeatureSelect { FEATURE_ALL = 0xffff } |
enum | vpBasicFeatureDeallocatorType { user , vpServo } |
Public Member Functions | |
vpFeatureDepth () | |
vpFeatureDepth & | buildFrom (const double &x, const double &y, const double &Z, const double &LogZoverZstar) |
void | display (const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const VP_OVERRIDE |
void | display (const vpCameraParameters &cam, const vpImage< vpRGBa > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const VP_OVERRIDE |
vpFeatureDepth * | duplicate () const VP_OVERRIDE |
vpColVector | error (const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) VP_OVERRIDE |
double | get_x () const |
double | get_y () const |
double | get_Z () const |
double | get_LogZoverZstar () const |
void | init () VP_OVERRIDE |
vpMatrix | interaction (unsigned int select=FEATURE_ALL) VP_OVERRIDE |
void | print (unsigned int select=FEATURE_ALL) const VP_OVERRIDE |
void | set_x (double x) |
void | set_y (double y) |
void | set_Z (double Z) |
void | set_LogZoverZstar (double LogZoverZstar) |
void | set_xyZLogZoverZstar (double x, double y, double Z, double logZZs) |
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 () |
vpBasicFeatureDeallocatorType | deallocate |
static unsigned int | selectAll () |
void | resetFlags () |
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 build() 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 164 of file vpFeatureDepth.h.
|
inherited |
Indicates who should deallocate the feature.
Enumerator | |
---|---|
user | |
vpServo |
Definition at line 88 of file vpBasicFeature.h.
|
inherited |
Enumerator | |
---|---|
FEATURE_ALL |
Definition at line 83 of file vpBasicFeature.h.
vpFeatureDepth::vpFeatureDepth | ( | ) |
Default constructor that build a visual feature.
Definition at line 84 of file vpFeatureDepth.cpp.
References init().
Referenced by duplicate().
vpFeatureDepth & 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 361 of file vpFeatureDepth.cpp.
References vpFeatureException::badInitializationError, vpBasicFeature::flags, vpBasicFeature::nbParameters, and vpBasicFeature::s.
|
inlineinherited |
Return the dimension of the feature vector .
Definition at line 110 of file vpBasicFeature.h.
|
virtual |
|
virtual |
|
virtual |
Create an object with the same type.
Implements vpBasicFeature.
Definition at line 400 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 306 of file vpFeatureDepth.cpp.
References vpFeatureException::badInitializationError, vpBasicFeature::FEATURE_ALL, vpBasicFeature::get_s(), vpBasicFeature::s, and vpColVector::sumSquare().
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 100 of file vpFeatureDepth.cpp.
References vpBasicFeature::s.
Referenced by print().
|
inherited |
Get the feature vector .
Definition at line 115 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpBasicFeature::s, and vpColVector::stack().
Referenced by vpServo::computeError(), vpBasicFeature::error(), error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), and vpGenericFeature::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 120 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 140 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 160 of file vpFeatureDepth.cpp.
Referenced by interaction(), and print().
|
inlineinherited |
Definition at line 123 of file vpBasicFeature.h.
|
inherited |
Get the feature vector dimension.
Definition at line 102 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpArray2D< Type >::getRows(), and vpBasicFeature::s.
|
virtual |
Initialize the memory space requested for 3D depth visual feature.
Implements vpBasicFeature.
Definition at line 65 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 209 of file vpFeatureDepth.cpp.
References vpFeatureException::badInitializationError, vpBasicFeature::deallocate, vpBasicFeature::FEATURE_ALL, vpBasicFeature::flags, get_x(), get_y(), get_Z(), vpBasicFeature::nbParameters, vpBasicFeature::resetFlags(), and vpBasicFeature::user.
|
inlinevirtualinherited |
Return element i in the state vector (usage : x = s[i] )
Definition at line 130 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 337 of file vpFeatureDepth.cpp.
References vpBasicFeature::FEATURE_ALL, get_LogZoverZstar(), get_x(), get_y(), and get_Z().
|
protectedinherited |
Definition at line 132 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
Referenced by vpFeatureVanishingPoint::interaction(), interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeaturePoint::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), and vpFeatureTranslation::interaction().
|
inlinestaticinherited |
void vpFeatureDepth::set_LogZoverZstar | ( | 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 92 of file vpFeatureDepth.cpp.
References vpBasicFeature::s.
Referenced by set_xyZLogZoverZstar().
void vpFeatureDepth::set_x | ( | 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 108 of file vpFeatureDepth.cpp.
References vpBasicFeature::flags.
Referenced by set_xyZLogZoverZstar().
void vpFeatureDepth::set_xyZLogZoverZstar | ( | double | x_, |
double | y_, | ||
double | Z_, | ||
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 174 of file vpFeatureDepth.cpp.
References vpBasicFeature::flags, vpBasicFeature::nbParameters, set_LogZoverZstar(), set_x(), set_y(), and set_Z().
void vpFeatureDepth::set_y | ( | 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 128 of file vpFeatureDepth.cpp.
References vpBasicFeature::flags.
Referenced by set_xyZLogZoverZstar().
void vpFeatureDepth::set_Z | ( | double | Z_ | ) |
Set the value of which represents the depth in the 3D camera frame.
Z_ | : value to set. |
Definition at line 148 of file vpFeatureDepth.cpp.
References vpBasicFeature::flags.
Referenced by set_xyZLogZoverZstar().
|
inlineinherited |
Definition at line 137 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 142 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
|
protectedinherited |
Definition at line 148 of file vpBasicFeature.h.
Referenced by vpFeatureVanishingPoint::interaction(), interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeaturePoint::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureSegment::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), and vpBasicFeature::operator=().
|
protectedinherited |
Dimension of the visual feature.
Definition at line 94 of file vpBasicFeature.h.
Referenced by vpFeatureMoment::duplicate(), vpGenericFeature::duplicate(), vpBasicFeature::error(), vpFeatureLuminanceMapping::error(), vpGenericFeature::error(), vpFeatureLuminance::error(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeatureLuminanceMapping::init(), vpFeaturePoint::init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureMoment::init(), vpFeatureLuminanceMapping::interaction(), vpFeatureMoment::interaction(), vpGenericFeature::interaction(), vpFeatureLuminance::interaction(), vpBasicFeature::operator=(), vpFeatureLuminance::operator=(), vpFeatureLuminanceMapping::operator=(), vpFeatureMoment::print(), vpGenericFeature::print(), vpGenericFeature::set_s(), vpGenericFeature::setError(), vpGenericFeature::setInteractionMatrix(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpGenericFeature::vpGenericFeature().
|
staticinherited |
Definition at line 81 of file vpBasicFeature.h.
Referenced by vpBasicFeature::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(), vpFeatureVanishingPoint::selectOneOverRho(), vpFeatureLine::selectRho(), vpFeaturePointPolar::selectRho(), vpFeatureLine::selectTheta(), vpFeaturePointPolar::selectTheta(), vpFeatureThetaU::selectTUx(), vpFeatureThetaU::selectTUy(), vpFeatureThetaU::selectTUz(), vpFeatureTranslation::selectTx(), vpFeatureTranslation::selectTy(), vpFeatureTranslation::selectTz(), vpFeatureEllipse::selectX(), vpFeaturePoint::selectX(), vpFeaturePoint3D::selectX(), vpFeatureVanishingPoint::selectX(), vpFeatureSegment::selectXc(), vpFeatureEllipse::selectY(), vpFeaturePoint::selectY(), vpFeaturePoint3D::selectY(), vpFeatureVanishingPoint::selectY(), vpFeatureSegment::selectYc(), and vpFeaturePoint3D::selectZ().
|
protectedinherited |
Ensure that all the parameters needed to compute the interaction matrix are set.
Definition at line 98 of file vpBasicFeature.h.
Referenced by vpFeatureLine::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeaturePoint::buildFrom(), buildFrom(), vpFeatureTranslation::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureMoment::duplicate(), init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeatureLuminance::init(), vpFeaturePoint::init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), vpFeatureMoment::init(), vpFeatureVanishingPoint::interaction(), interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeaturePoint::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(), set_x(), vpFeatureEllipse::set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureVanishingPoint::set_x(), vpFeatureEllipse::set_xy(), vpFeaturePoint::set_xyZ(), vpFeaturePoint3D::set_XYZ(), set_xyZLogZoverZstar(), set_y(), vpFeatureEllipse::set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeatureVanishingPoint::set_y(), set_Z(), vpFeatureLuminance::set_Z(), vpFeaturePoint::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 100 of file vpBasicFeature.h.
Referenced by vpFeatureLine::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeaturePoint::buildFrom(), buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureMoment::duplicate(), init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeatureLuminance::init(), vpFeaturePoint::init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), vpFeatureMoment::init(), vpFeatureVanishingPoint::interaction(), interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeaturePoint::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureSegment::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 92 of file vpBasicFeature.h.
Referenced by vpFeatureLine::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeaturePoint::buildFrom(), buildFrom(), vpFeatureTranslation::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureLuminance::buildFrom(), vpFeatureLuminanceMapping::buildFrom(), vpFeatureEllipse::display(), vpFeatureMoment::duplicate(), vpFeatureVanishingPoint::error(), vpBasicFeature::error(), error(), vpFeatureEllipse::error(), vpFeatureLine::error(), vpFeatureMomentAlpha::error(), vpFeaturePoint::error(), vpFeaturePoint3D::error(), vpFeaturePointPolar::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpGenericFeature::error(), vpFeatureLuminance::error(), vpFeatureLuminanceMapping::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(), vpFeaturePoint::get_x(), vpFeaturePoint3D::get_X(), vpFeatureVanishingPoint::get_x(), vpFeaturePoint::get_y(), vpFeaturePoint3D::get_Y(), vpFeatureVanishingPoint::get_y(), vpFeaturePoint3D::get_Z(), vpFeatureVanishingPoint::getAlpha(), vpFeatureVanishingPoint::getAtanOneOverRho(), vpBasicFeature::getDimension(), vpFeatureVanishingPoint::getOneOverRho(), init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeaturePoint::init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), vpGenericFeature::init(), vpFeatureLuminanceMapping::init(), vpFeatureLuminance::init(), vpFeatureMoment::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpFeatureLuminanceMapping::interaction(), vpBasicFeature::operator=(), vpFeatureLuminance::operator=(), vpFeatureLuminanceMapping::operator=(), vpFeatureEllipse::print(), vpFeatureLine::print(), vpFeatureLuminanceMapping::print(), vpFeatureMoment::print(), vpFeatureSegment::print(), vpFeatureThetaU::print(), vpFeatureTranslation::print(), vpGenericFeature::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(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureVanishingPoint::set_x(), vpFeatureEllipse::set_xy(), vpFeatureEllipse::set_y(), vpFeaturePoint::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().