Visual Servoing Platform  version 3.5.1 under development (2023-09-22)
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

 vpBasicFeature ()
 
 vpBasicFeature (const vpBasicFeature &f)
 
virtual ~vpBasicFeature ()
 

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

vpBasicFeatureDeallocatorType deallocate
 
unsigned int dimension_s ()
 
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
 
virtual void init ()=0
 
virtual vpColVector error (const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL)
 
vpColVector get_s (unsigned int select=FEATURE_ALL) const
 
vpBasicFeatureDeallocatorType getDeallocate ()
 
unsigned int getDimension (unsigned int select=FEATURE_ALL) const
 
virtual vpMatrix interaction (unsigned int select=FEATURE_ALL)=0
 
virtual double operator[] (unsigned int i) const
 
vpBasicFeatureoperator= (const vpBasicFeature &f)
 
virtual void print (unsigned int select=FEATURE_ALL) const =0
 
virtual vpBasicFeatureduplicate () const =0
 
void setDeallocate (vpBasicFeatureDeallocatorType d)
 
void setFlags ()
 
static unsigned int selectAll ()
 
void resetFlags ()
 

Detailed Description

class that defines what is a visual feature

Examples
manServoMomentsSimple.cpp.

Definition at line 76 of file vpBasicFeature.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
FEATURE_ALL 

Definition at line 81 of file vpBasicFeature.h.

◆ vpBasicFeatureDeallocatorType

Indicates who should deallocate the feature.

Enumerator
user 
vpServo 

Definition at line 87 of file vpBasicFeature.h.

Constructor & Destructor Documentation

◆ vpBasicFeature() [1/2]

vpBasicFeature::vpBasicFeature ( )

Default constructor.

Definition at line 58 of file vpBasicFeature.cpp.

◆ vpBasicFeature() [2/2]

vpBasicFeature::vpBasicFeature ( const vpBasicFeature f)

Copy constructor.

Definition at line 74 of file vpBasicFeature.cpp.

◆ ~vpBasicFeature()

vpBasicFeature::~vpBasicFeature ( )
virtual

Destructor that free allocated memory.

Definition at line 63 of file vpBasicFeature.cpp.

References flags.

Member Function Documentation

◆ dimension_s()

unsigned int vpBasicFeature::dimension_s ( )
inline

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

Definition at line 109 of file vpBasicFeature.h.

◆ display() [1/2]

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

◆ display() [2/2]

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

◆ duplicate()

◆ error()

vpColVector vpBasicFeature::error ( const vpBasicFeature s_star,
unsigned int  select = FEATURE_ALL 
)
virtual

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

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

Examples
manServoMomentsSimple.cpp.

Definition at line 149 of file vpBasicFeature.cpp.

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

Referenced by vpServo::computeError().

◆ get_s()

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

◆ getDeallocate()

vpBasicFeatureDeallocatorType vpBasicFeature::getDeallocate ( )
inline

Definition at line 122 of file vpBasicFeature.h.

◆ getDimension()

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

Get the feature vector dimension.

Definition at line 99 of file vpBasicFeature.cpp.

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

◆ init()

◆ interaction()

virtual vpMatrix vpBasicFeature::interaction ( unsigned int  select = FEATURE_ALL)
pure virtual

◆ operator=()

vpBasicFeature & vpBasicFeature::operator= ( const vpBasicFeature f)

Copy operator.

Definition at line 83 of file vpBasicFeature.cpp.

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

◆ operator[]()

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

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

Definition at line 129 of file vpBasicFeature.h.

◆ print()

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

◆ resetFlags()

◆ selectAll()

static unsigned int vpBasicFeature::selectAll ( )
inlinestatic

Select all the features.

Definition at line 141 of file vpBasicFeature.h.

◆ setDeallocate()

void vpBasicFeature::setDeallocate ( vpBasicFeatureDeallocatorType  d)
inline

Definition at line 136 of file vpBasicFeature.h.

Referenced by vpServo::addFeature().

◆ setFlags()

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 139 of file vpBasicFeature.cpp.

References flags, and nbParameters.

Member Data Documentation

◆ deallocate

◆ dim_s

◆ FEATURE_LINE

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 79 of file vpBasicFeature.h.

Referenced by error(), vpGenericFeature::error(), get_s(), 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(), vpFeatureEllipse::selectMu02(), vpFeatureEllipse::selectMu11(), vpFeatureEllipse::selectMu20(), 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().

◆ flags

bool* vpBasicFeature::flags
protected

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

Definition at line 97 of file vpBasicFeature.h.

Referenced by vpFeatureTranslation::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureDepth::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(), vpFeatureDepth::interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeaturePoint::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureSegment::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), operator=(), resetFlags(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_rhoThetaZ(), vpFeaturePointPolar::set_theta(), vpFeatureThetaU::set_TUx(), vpFeatureThetaU::set_TUy(), vpFeatureThetaU::set_TUz(), vpFeatureDepth::set_x(), vpFeatureEllipse::set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureVanishingPoint::set_x(), vpFeatureEllipse::set_xy(), vpFeaturePoint::set_xyZ(), vpFeaturePoint3D::set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureDepth::set_y(), vpFeatureEllipse::set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeatureVanishingPoint::set_y(), vpFeatureDepth::set_Z(), vpFeatureLuminance::set_Z(), vpFeaturePoint::set_Z(), vpFeaturePoint3D::set_Z(), vpFeaturePointPolar::set_Z(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), setFlags(), vpFeatureEllipse::setMoments(), vpFeatureVanishingPoint::setOneOverRho(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and ~vpBasicFeature().

◆ nbParameters

◆ s

vpColVector vpBasicFeature::s
protected

State of the visual feature.

Definition at line 91 of file vpBasicFeature.h.

Referenced by vpFeatureTranslation::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeatureLuminance::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureEllipse::display(), vpFeatureMoment::duplicate(), vpFeatureVanishingPoint::error(), error(), vpFeatureDepth::error(), vpFeatureEllipse::error(), vpFeatureLine::error(), vpFeatureMomentAlpha::error(), vpFeaturePoint::error(), vpFeaturePoint3D::error(), vpFeaturePointPolar::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpGenericFeature::error(), vpFeatureLuminance::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(), 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(), getDimension(), vpFeatureVanishingPoint::getOneOverRho(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeaturePoint::init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), vpGenericFeature::init(), vpFeatureLuminance::init(), vpFeatureMoment::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), operator=(), vpFeatureEllipse::print(), vpFeatureLine::print(), vpFeatureMoment::print(), vpFeatureSegment::print(), vpFeatureThetaU::print(), vpFeatureTranslation::print(), vpGenericFeature::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(), 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().