Visual Servoing Platform  version 3.2.0
vpBasicFeature Class Referenceabstract

#include <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, const unsigned int select=FEATURE_ALL)
 
vpColVector get_s (unsigned int select=FEATURE_ALL) const
 
vpBasicFeatureDeallocatorType getDeallocate ()
 
unsigned int getDimension (const unsigned int select=FEATURE_ALL) const
 
virtual vpMatrix interaction (const unsigned int select=FEATURE_ALL)=0
 
virtual double operator[] (const unsigned int i) const
 
vpBasicFeatureoperator= (const vpBasicFeature &f)
 
virtual void print (const 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.

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,
const unsigned int  select = FEATURE_ALL 
)
virtual

◆ get_s()

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

Get the feature vector $\bf s$.

Examples
servoAfma6Ellipse2DCamVelocity.cpp.

Definition at line 113 of file vpBasicFeature.cpp.

◆ getDeallocate()

vpBasicFeatureDeallocatorType vpBasicFeature::getDeallocate ( )
inline

Definition at line 122 of file vpBasicFeature.h.

◆ getDimension()

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

Get the feature vector dimension.

Definition at line 99 of file vpBasicFeature.cpp.

◆ init()

◆ interaction()

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

◆ operator=()

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

Copy operator.

Definition at line 83 of file vpBasicFeature.cpp.

◆ operator[]()

virtual double vpBasicFeature::operator[] ( const 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 ( const unsigned int  select = FEATURE_ALL) const
pure virtual

◆ resetFlags()

void vpBasicFeature::resetFlags ( )
protected

Definition at line 130 of file vpBasicFeature.cpp.

References flags, and nbParameters.

◆ 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.

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

Member Data Documentation

◆ deallocate

vpBasicFeatureDeallocatorType vpBasicFeature::deallocate
protected

Definition at line 147 of file vpBasicFeature.h.

◆ dim_s

unsigned int vpBasicFeature::dim_s
protected

Dimension of the visual feature.

Definition at line 93 of file vpBasicFeature.h.

Referenced by vpGenericFeature::duplicate(), vpFeatureVanishingPoint::init(), vpFeatureEllipse::init(), and vpFeatureLuminance::init().

◆ 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 vpFeatureEllipse::selectMu02(), vpFeatureEllipse::selectMu11(), vpFeatureEllipse::selectMu20(), vpFeatureVanishingPoint::selectY(), and vpFeatureEllipse::selectY().

◆ flags

bool* vpBasicFeature::flags
protected

◆ nbParameters

unsigned int vpBasicFeature::nbParameters
protected

Number of parameters needed to compute the interaction matrix.

Definition at line 99 of file vpBasicFeature.h.

Referenced by vpFeatureVanishingPoint::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeatureVanishingPoint::init(), vpFeatureEllipse::init(), resetFlags(), and vpFeatureEllipse::setABC().

◆ s