Visual Servoing Platform  version 3.0.0
vpBasicFeature Class Referenceabstract

#include <visp3/visual_features/vpBasicFeature.h>

+ Inheritance diagram for vpBasicFeature:

Public Types

enum  { FEATURE_ALL = 0xffff }
 
enum  vpBasicFeatureDeallocatorType { user, vpServo }
 

Public Member Functions

unsigned int dimension_s ()
 
virtual void init ()=0
 
 vpBasicFeature ()
 
 vpBasicFeature (const vpBasicFeature &f)
 
vpBasicFeatureoperator= (const vpBasicFeature &f)
 
virtual ~vpBasicFeature ()
 
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
 
virtual vpMatrix interaction (const unsigned int select=FEATURE_ALL)=0
 
virtual vpColVector error (const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
 
virtual void print (const unsigned int select=FEATURE_ALL) const =0
 
virtual vpBasicFeatureduplicate () const =0
 
virtual void display (const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const =0
 
virtual void display (const vpCameraParameters &cam, const vpImage< vpRGBa > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const =0
 
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]
 

Protected Member Functions

void resetFlags ()
 

Protected Attributes

vpColVector s
 
unsigned int dim_s
 
bool * flags
 
unsigned int nbParameters
 
vpBasicFeatureDeallocatorType deallocate
 

Detailed Description

class that defines what is a visual feature

Examples:
manServoMomentsSimple.cpp.

Definition at line 79 of file vpBasicFeature.h.

Member Enumeration Documentation

anonymous enum
Enumerator
FEATURE_ALL 

Definition at line 84 of file vpBasicFeature.h.

Indicates who should deallocate the feature.

Enumerator
user 
vpServo 

Definition at line 153 of file vpBasicFeature.h.

Constructor & Destructor Documentation

vpBasicFeature::vpBasicFeature ( )

Default constructor.

Definition at line 70 of file vpBasicFeature.cpp.

vpBasicFeature::vpBasicFeature ( const vpBasicFeature f)

Copy constructor.

Definition at line 89 of file vpBasicFeature.cpp.

vpBasicFeature::~vpBasicFeature ( )
virtual

Destructor that free allocated memory.

Definition at line 78 of file vpBasicFeature.cpp.

References flags.

Member Function Documentation

unsigned int vpBasicFeature::dimension_s ( )
inline

Return the dimension of the feature vector $\bf s$.

Definition at line 101 of file vpBasicFeature.h.

virtual void vpBasicFeature::display ( const vpCameraParameters cam,
const vpImage< unsigned char > &  I,
const vpColor color = vpColor::green,
unsigned int  thickness = 1 
) const
pure virtual
virtual void vpBasicFeature::display ( const vpCameraParameters cam,
const vpImage< vpRGBa > &  I,
const vpColor color = vpColor::green,
unsigned int  thickness = 1 
) const
pure virtual
vpColVector vpBasicFeature::error ( const vpBasicFeature s_star,
const unsigned int  select = FEATURE_ALL 
)
virtual

Compute the error between two visual features from a subset of the possible features.

Reimplemented in vpFeatureTranslation, vpFeaturePointPolar, vpFeatureThetaU, vpFeaturePoint3D, vpFeatureLine, vpFeaturePoint, vpFeatureDepth, vpGenericFeature, vpFeatureMomentAlpha, vpFeatureLuminance, vpFeatureVanishingPoint, vpFeatureEllipse, and vpFeatureSegment.

Examples:
manServoMomentsSimple.cpp.

Definition at line 168 of file vpBasicFeature.cpp.

References dim_s, FEATURE_LINE, get_s(), and s.

Referenced by vpServo::computeError().

vpColVector vpBasicFeature::get_s ( unsigned int  select = FEATURE_ALL) const
vpBasicFeatureDeallocatorType vpBasicFeature::getDeallocate ( )
inline

Definition at line 163 of file vpBasicFeature.h.

unsigned int vpBasicFeature::getDimension ( const unsigned int  select = FEATURE_ALL) const

Get the feature vector dimension.

Definition at line 115 of file vpBasicFeature.cpp.

References dim_s, FEATURE_LINE, vpArray2D< Type >::getRows(), and s.

virtual vpMatrix vpBasicFeature::interaction ( const unsigned int  select = FEATURE_ALL)
pure virtual
vpBasicFeature & vpBasicFeature::operator= ( const vpBasicFeature f)

Copy operator.

Definition at line 98 of file vpBasicFeature.cpp.

References deallocate, dim_s, flags, nbParameters, and s.

virtual double vpBasicFeature::operator[] ( const unsigned int  i) const
inlinevirtual

Return element i in the state vector (usage : x = s[i] )

Definition at line 112 of file vpBasicFeature.h.

virtual void vpBasicFeature::print ( const unsigned int  select = FEATURE_ALL) const
pure virtual
static unsigned int vpBasicFeature::selectAll ( )
inlinestatic

Select all the features.

Definition at line 115 of file vpBasicFeature.h.

void vpBasicFeature::setDeallocate ( vpBasicFeatureDeallocatorType  d)
inline

Definition at line 162 of file vpBasicFeature.h.

Referenced by vpServo::addFeature().

void vpBasicFeature::setFlags ( )

Set feature flags to true to prevent warning when re-computing the interaction matrix without having updated the feature.

Definition at line 158 of file vpBasicFeature.cpp.

References flags, and nbParameters.

Member Data Documentation

const unsigned int vpBasicFeature::FEATURE_LINE
static
Initial value:
=
{
(unsigned int)(1 << 0), (unsigned int)(1 << 1),
(unsigned int)(1 << 2), (unsigned int)(1 << 3),
(unsigned int)(1 << 4), (unsigned int)(1 << 5),
(unsigned int)(1 << 6), (unsigned int)(1 << 7),
(unsigned int)(1 << 8), (unsigned int)(1 << 9),
(unsigned int)(1 << 10), (unsigned int)(1 << 11),
(unsigned int)(1 << 12), (unsigned int)(1 << 13),
(unsigned int)(1 << 14), (unsigned int)(1 << 15),
(unsigned int)(1 << 16), (unsigned int)(1 << 17),
(unsigned int)(1 << 18), (unsigned int)(1 << 19),
(unsigned int)(1 << 20), (unsigned int)(1 << 21),
(unsigned int)(1 << 22), (unsigned int)(1 << 23),
(unsigned int)(1 << 24), (unsigned int)(1 << 25),
(unsigned int)(1 << 26), (unsigned int)(1 << 27),
(unsigned int)(1 << 28), (unsigned int)(1 << 29),
(unsigned int)(1 << 30), (unsigned int)(1 << 31)
}

Definition at line 82 of file vpBasicFeature.h.

Referenced by error(), vpGenericFeature::error(), get_s(), getDimension(), vpFeatureMoment::getDimension(), vpGenericFeature::interaction(), vpFeatureMoment::interaction(), vpGenericFeature::print(), vpFeatureMoment::print(), vpFeatureSegment::selectAlpha(), vpFeatureSegment::selectL(), vpFeatureEllipse::selectMu02(), vpFeatureEllipse::selectMu11(), vpFeatureEllipse::selectMu20(), vpFeatureLine::selectRho(), vpFeaturePointPolar::selectRho(), vpFeatureLine::selectTheta(), vpFeaturePointPolar::selectTheta(), vpFeatureThetaU::selectTUx(), vpFeatureThetaU::selectTUy(), vpFeatureThetaU::selectTUz(), vpFeatureTranslation::selectTx(), vpFeatureTranslation::selectTy(), vpFeatureTranslation::selectTz(), vpFeatureEllipse::selectX(), vpFeatureVanishingPoint::selectX(), vpFeaturePoint::selectX(), vpFeaturePoint3D::selectX(), vpFeatureSegment::selectXc(), vpFeatureEllipse::selectY(), vpFeatureVanishingPoint::selectY(), vpFeaturePoint::selectY(), vpFeaturePoint3D::selectY(), vpFeatureSegment::selectYc(), and vpFeaturePoint3D::selectZ().

bool* vpBasicFeature::flags
protected

Ensure that all the parameters needed to compute the iteraction matrix are set.

Definition at line 95 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(), vpFeaturePoint::init(), vpFeatureMoment::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(), vpFeatureThetaU::interaction(), vpFeaturePointPolar::interaction(), vpFeatureTranslation::interaction(), operator=(), 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(), setFlags(), vpFeatureEllipse::setMu(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and ~vpBasicFeature().

vpColVector vpBasicFeature::s
protected

State of the visual feature.

Definition at line 90 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(), vpFeatureEllipse::error(), vpFeatureVanishingPoint::error(), error(), vpFeatureLuminance::error(), vpFeatureMomentAlpha::error(), vpGenericFeature::error(), vpFeatureDepth::error(), vpFeaturePoint::error(), vpFeatureLine::error(), vpFeaturePoint3D::error(), vpFeatureThetaU::error(), vpFeaturePointPolar::error(), vpFeatureTranslation::error(), vpFeatureDepth::get_LogZoverZstar(), vpFeaturePointPolar::get_rho(), 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(), getDimension(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpGenericFeature::init(), vpFeaturePoint::init(), vpFeatureMoment::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), 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(), 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().