Visual Servoing Platform  version 3.3.0 under development (2020-02-17)
vpFeatureEllipse Class Reference

#include <visp3/visual_features/vpFeatureEllipse.h>

+ Inheritance diagram for vpFeatureEllipse:

Public Types

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

Public Member Functions

 vpFeatureEllipse ()
 
virtual ~vpFeatureEllipse ()
 
 vpFeatureEllipse (double x, double y, double mu20, double mu11, double mu02)
 
void buildFrom (double x, double y, double mu20, double mu11, double mu02)
 
void buildFrom (double x, double y, double mu20, double mu11, double mu02, double A, double B, double C)
 
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
 
vpFeatureEllipseduplicate () const
 
vpColVector error (const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL)
 
vpColVector error (unsigned int select=FEATURE_ALL)
 
double get_x () const
 
double get_y () const
 
double getMu20 () const
 
double getMu11 () const
 
double getMu02 () const
 
void init ()
 
vpMatrix interaction (unsigned int select=FEATURE_ALL)
 
void print (unsigned int select=FEATURE_ALL) const
 
void set_x (double x)
 
void set_y (double y)
 
void set_xy (double x, double y)
 
void setABC (double A, double B, double C)
 
void setMu (double mu20, double mu11, double mu02)
 
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 ()
 

Static Public Member Functions

static unsigned int selectX ()
 
static unsigned int selectY ()
 
static unsigned int selectMu20 ()
 
static unsigned int selectMu11 ()
 
static unsigned int selectMu02 ()
 
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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
FEATURE_ALL 

Definition at line 82 of file vpBasicFeature.h.

◆ vpBasicFeatureDeallocatorType

Indicates who should deallocate the feature.

Enumerator
user 
vpServo 

Definition at line 88 of file vpBasicFeature.h.

Constructor & Destructor Documentation

◆ vpFeatureEllipse() [1/2]

vpFeatureEllipse::vpFeatureEllipse ( )

Default constructor.

Definition at line 90 of file vpFeatureEllipse.cpp.

References init().

Referenced by duplicate().

◆ ~vpFeatureEllipse()

virtual vpFeatureEllipse::~vpFeatureEllipse ( )
inlinevirtual

◆ vpFeatureEllipse() [2/2]

vpFeatureEllipse::vpFeatureEllipse ( double  x,
double  y,
double  mu20,
double  mu11,
double  mu02 
)

basic constructor

coordinates

Member Function Documentation

◆ buildFrom() [1/2]

void vpFeatureEllipse::buildFrom ( double  x,
double  y,
double  mu20,
double  mu11,
double  mu02 
)

◆ buildFrom() [2/2]

void vpFeatureEllipse::buildFrom ( double  x,
double  y,
double  mu20,
double  mu11,
double  mu02,
double  A,
double  B,
double  C 
)

◆ dimension_s()

unsigned int vpBasicFeature::dimension_s ( )
inlineinherited

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

Definition at line 110 of file vpBasicFeature.h.

References vpColor::green.

◆ display() [1/2]

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

Display ellipse feature.

Parameters
cam: Camera parameters.
I: Image on which features have to be displayed.
color: Color used to display the feature.
thickness: Thickness of the feature representation.

Implements vpBasicFeature.

Examples:
testTrackDot.cpp.

Definition at line 367 of file vpFeatureEllipse.cpp.

References vpFeatureDisplay::displayEllipse(), vpBasicFeature::s, and vpERROR_TRACE.

◆ display() [2/2]

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

Display ellipse feature.

Parameters
cam: Camera parameters.
I: Color image on which features have to be displayed.
color: Color used to display the feature.
thickness: Thickness of the feature representation.

Implements vpBasicFeature.

Definition at line 395 of file vpFeatureEllipse.cpp.

References vpFeatureDisplay::displayEllipse(), vpBasicFeature::s, and vpERROR_TRACE.

◆ duplicate()

vpFeatureEllipse * vpFeatureEllipse::duplicate ( ) const
virtual

Feature duplication.

for memory issue (used by the vpServo class only)

Implements vpBasicFeature.

Definition at line 415 of file vpFeatureEllipse.cpp.

References vpFeatureEllipse().

◆ error() [1/2]

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

compute the error between two visual features from a subset a the possible features

Reimplemented from vpBasicFeature.

Definition at line 226 of file vpFeatureEllipse.cpp.

References vpBasicFeature::s, selectMu02(), selectMu11(), selectMu20(), selectX(), selectY(), and vpColVector::stack().

Referenced by vpPoseFeatures::addFeatureSegment().

◆ error() [2/2]

vpColVector vpFeatureEllipse::error ( unsigned int  select = FEATURE_ALL)

compute the error between a visual features and zero

◆ get_s()

◆ get_x()

double vpFeatureEllipse::get_x ( ) const
inline

Definition at line 99 of file vpFeatureEllipse.h.

◆ get_y()

double vpFeatureEllipse::get_y ( ) const
inline

Definition at line 100 of file vpFeatureEllipse.h.

◆ getDeallocate()

vpBasicFeatureDeallocatorType vpBasicFeature::getDeallocate ( )
inlineinherited

Definition at line 123 of file vpBasicFeature.h.

◆ getDimension()

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

Get the feature vector dimension.

Definition at line 100 of file vpBasicFeature.cpp.

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

Referenced by vpFeatureMoment::vpFeatureMoment().

◆ getMu02()

double vpFeatureEllipse::getMu02 ( ) const
inline

◆ getMu11()

double vpFeatureEllipse::getMu11 ( ) const
inline

Definition at line 102 of file vpFeatureEllipse.h.

◆ getMu20()

double vpFeatureEllipse::getMu20 ( ) const
inline

Definition at line 101 of file vpFeatureEllipse.h.

◆ init()

void vpFeatureEllipse::init ( void  )
virtual

Default initialization.

Implements vpBasicFeature.

Definition at line 72 of file vpFeatureEllipse.cpp.

References vpBasicFeature::dim_s, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpColVector::resize(), and vpBasicFeature::s.

Referenced by vpFeatureEllipse().

◆ interaction()

◆ operator[]()

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

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

Definition at line 130 of file vpBasicFeature.h.

◆ print()

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

print the name of the feature

Implements vpBasicFeature.

Examples:
servoSimuCircle2DCamVelocityDisplay.cpp.

Definition at line 270 of file vpFeatureEllipse.cpp.

References vpBasicFeature::s, selectMu02(), selectMu11(), selectMu20(), selectX(), and selectY().

◆ resetFlags()

◆ selectAll()

static unsigned int vpBasicFeature::selectAll ( )
inlinestaticinherited

Select all the features.

Definition at line 142 of file vpBasicFeature.h.

◆ selectMu02()

unsigned int vpFeatureEllipse::selectMu02 ( )
static

Definition at line 425 of file vpFeatureEllipse.cpp.

References vpBasicFeature::FEATURE_LINE.

Referenced by error(), interaction(), and print().

◆ selectMu11()

unsigned int vpFeatureEllipse::selectMu11 ( )
static

Definition at line 424 of file vpFeatureEllipse.cpp.

References vpBasicFeature::FEATURE_LINE.

Referenced by error(), interaction(), and print().

◆ selectMu20()

unsigned int vpFeatureEllipse::selectMu20 ( )
static

Definition at line 423 of file vpFeatureEllipse.cpp.

References vpBasicFeature::FEATURE_LINE.

Referenced by error(), interaction(), and print().

◆ selectX()

unsigned int vpFeatureEllipse::selectX ( )
static

vpBasicFeature method instantiation

Definition at line 421 of file vpFeatureEllipse.cpp.

References vpBasicFeature::FEATURE_LINE.

Referenced by error(), interaction(), and print().

◆ selectY()

unsigned int vpFeatureEllipse::selectY ( )
static

Definition at line 422 of file vpFeatureEllipse.cpp.

References vpBasicFeature::FEATURE_LINE.

Referenced by error(), interaction(), and print().

◆ set_x()

void vpFeatureEllipse::set_x ( double  x)

Definition at line 319 of file vpFeatureEllipse.cpp.

References vpBasicFeature::flags, and vpBasicFeature::s.

◆ set_xy()

void vpFeatureEllipse::set_xy ( double  x,
double  y 
)

Definition at line 331 of file vpFeatureEllipse.cpp.

References vpBasicFeature::flags, and vpBasicFeature::s.

◆ set_y()

void vpFeatureEllipse::set_y ( double  y)

Definition at line 325 of file vpFeatureEllipse.cpp.

References vpBasicFeature::flags, and vpBasicFeature::s.

◆ setABC()

void vpFeatureEllipse::setABC ( double  A,
double  B,
double  C 
)

◆ setDeallocate()

void vpBasicFeature::setDeallocate ( vpBasicFeatureDeallocatorType  d)
inlineinherited

Definition at line 137 of file vpBasicFeature.h.

Referenced by vpServo::addFeature().

◆ setFlags()

void vpBasicFeature::setFlags ( )
inherited

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

Definition at line 141 of file vpBasicFeature.cpp.

References vpBasicFeature::flags, and vpBasicFeature::nbParameters.

◆ setMu()

void vpFeatureEllipse::setMu ( double  mu20,
double  mu11,
double  mu02 
)

Definition at line 348 of file vpFeatureEllipse.cpp.

References vpBasicFeature::flags, and vpBasicFeature::s.

Member Data Documentation

◆ deallocate

◆ dim_s

◆ FEATURE_LINE

const unsigned int vpBasicFeature::FEATURE_LINE
staticinherited
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 80 of file vpBasicFeature.h.

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

◆ flags

bool* vpBasicFeature::flags
protectedinherited

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

Definition at line 98 of file vpBasicFeature.h.

Referenced by buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureMoment::duplicate(), init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeaturePoint::init(), vpFeatureMoment::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::interaction(), interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeatureThetaU::interaction(), vpFeaturePointPolar::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(), vpFeatureVanishingPoint::set_x(), set_x(), vpFeatureDepth::set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), set_xy(), vpFeaturePoint::set_xyZ(), vpFeaturePoint3D::set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureVanishingPoint::set_y(), 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(), setABC(), vpFeatureLine::setABCD(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), vpBasicFeature::setFlags(), setMu(), vpFeatureVanishingPoint::setOneOverRho(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpBasicFeature::~vpBasicFeature().

◆ nbParameters

◆ s

vpColVector vpBasicFeature::s
protectedinherited

State of the visual feature.

Definition at line 92 of file vpBasicFeature.h.

Referenced by buildFrom(), vpFeatureLuminance::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), display(), vpFeatureMoment::duplicate(), error(), vpFeatureVanishingPoint::error(), vpFeatureLuminance::error(), vpBasicFeature::error(), vpFeatureMomentAlpha::error(), vpFeatureDepth::error(), vpGenericFeature::error(), vpFeaturePoint::error(), vpFeatureLine::error(), vpFeaturePoint3D::error(), vpFeatureThetaU::error(), vpFeaturePointPolar::error(), vpFeatureTranslation::error(), vpFeatureDepth::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(), vpFeatureVanishingPoint::getAlpha(), vpFeatureVanishingPoint::getAtanOneOverRho(), vpBasicFeature::getDimension(), vpFeatureVanishingPoint::getOneOverRho(), vpFeatureVanishingPoint::init(), init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpGenericFeature::init(), vpFeaturePoint::init(), vpFeatureMoment::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), 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(), vpFeatureVanishingPoint::set_x(), set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), set_xy(), vpFeatureVanishingPoint::set_y(), set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeaturePoint3D::set_Z(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), setMu(), vpFeatureVanishingPoint::setOneOverRho(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), and vpGenericFeature::vpGenericFeature().