Visual Servoing Platform  version 3.6.1 under development (2024-11-21)
vpFeatureEllipse Class Reference

#include <visp3/visual_features/vpFeatureEllipse.h>

+ Inheritance diagram for vpFeatureEllipse:

Public Types

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

Public Member Functions

 vpFeatureEllipse ()
 
 vpFeatureEllipse (double x, double y, double n20, double n11, double n02)
 
vpFeatureEllipsebuildFrom (const double &x, const double &y, const double &n20, const double &n11, const double &n02)
 
vpFeatureEllipsebuildFrom (const double &x, const double &y, const double &n20, const double &n11, const double &n02, const double &A, const double &B, const double &C)
 
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
 
vpFeatureEllipseduplicate () 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_n20 () const
 
double get_n11 () const
 
double get_n02 () 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_xy (double x, double y)
 
void setABC (double A, double B, double C)
 
void setMoments (double n20, double n11, double n02)
 

Static Public Member Functions

static unsigned int selectX ()
 
static unsigned int selectY ()
 
static unsigned int select_n20 ()
 
static unsigned int select_n11 ()
 
static unsigned int select_n02 ()
 

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 ()
 
static unsigned int selectAll ()
 
vpBasicFeatureDeallocatorType deallocate
 
void resetFlags ()
 

Detailed Description

Member Enumeration Documentation

◆ vpBasicFeatureDeallocatorType

Indicates who should deallocate the feature.

Enumerator
user 
vpServo 

Definition at line 88 of file vpBasicFeature.h.

◆ vpBasicFeatureSelect

Enumerator
FEATURE_ALL 

Definition at line 83 of file vpBasicFeature.h.

Constructor & Destructor Documentation

◆ vpFeatureEllipse() [1/2]

vpFeatureEllipse::vpFeatureEllipse ( )

Default constructor.

Definition at line 83 of file vpFeatureEllipse.cpp.

References init().

Referenced by duplicate().

◆ vpFeatureEllipse() [2/2]

vpFeatureEllipse::vpFeatureEllipse ( double  x,
double  y,
double  n20,
double  n11,
double  n02 
)

basic constructor

coordinates

Definition at line 84 of file vpFeatureEllipse.cpp.

References buildFrom().

Member Function Documentation

◆ buildFrom() [1/2]

vpFeatureEllipse & vpFeatureEllipse::buildFrom ( const double &  x,
const double &  y,
const double &  n20,
const double &  n11,
const double &  n02 
)

◆ buildFrom() [2/2]

vpFeatureEllipse & vpFeatureEllipse::buildFrom ( const double &  x,
const double &  y,
const double &  n20,
const double &  n11,
const double &  n02,
const double &  A,
const double &  B,
const 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.

◆ 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 378 of file vpFeatureEllipse.cpp.

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

◆ 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 400 of file vpFeatureEllipse.cpp.

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

◆ duplicate()

vpFeatureEllipse * vpFeatureEllipse::duplicate ( ) const
virtual

Feature duplication.

For memory issue (used by the vpServo class only).

Implements vpBasicFeature.

Definition at line 414 of file vpFeatureEllipse.cpp.

References vpFeatureEllipse().

◆ error()

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 220 of file vpFeatureEllipse.cpp.

References vpBasicFeature::s, select_n02(), select_n11(), select_n20(), selectX(), selectY(), and vpColVector::stack().

◆ get_n02()

double vpFeatureEllipse::get_n02 ( ) const
inline

Returns the visual feature corresponding to the second order centered moments of the ellipse normalized by its area $n_02 = mu_02/a$.

Definition at line 112 of file vpFeatureEllipse.h.

◆ get_n11()

double vpFeatureEllipse::get_n11 ( ) const
inline

Returns the visual feature corresponding to the second order centered moments of the ellipse normalized by its area $n_11 = mu_11/a$.

Definition at line 107 of file vpFeatureEllipse.h.

◆ get_n20()

double vpFeatureEllipse::get_n20 ( ) const
inline

Returns the visual feature corresponding to the second order centered moments of the ellipse normalized by its area $n_20 = mu_20/a$.

Definition at line 102 of file vpFeatureEllipse.h.

◆ get_s()

◆ get_x()

double vpFeatureEllipse::get_x ( ) const
inline

Returns the visual feature corresponding to the ellipse centroid coordinate along camera x-axis.

Definition at line 93 of file vpFeatureEllipse.h.

◆ get_y()

double vpFeatureEllipse::get_y ( ) const
inline

Returns the visual feature corresponding to the ellipse centroid coordinate along camera y-axis.

Definition at line 97 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.

Examples
testPoint.cpp.

Definition at line 102 of file vpBasicFeature.cpp.

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

◆ init()

BEGIN_VISP_NAMESPACE void vpFeatureEllipse::init ( void  )
virtual

Default initialization.

Implements vpBasicFeature.

Definition at line 65 of file vpFeatureEllipse.cpp.

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

Referenced by vpFeatureEllipse().

◆ interaction()

vpMatrix vpFeatureEllipse::interaction ( unsigned int  select = FEATURE_ALL)
virtual

◆ 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 265 of file vpFeatureEllipse.cpp.

References vpBasicFeature::s, select_n02(), select_n11(), select_n20(), selectX(), and selectY().

◆ resetFlags()

◆ select_n02()

unsigned int vpFeatureEllipse::select_n02 ( )
static

Select as visual feature second order centered moments of the ellipse normalized by its area that corresponds to $n_02 = mu_02/a$.

Definition at line 443 of file vpFeatureEllipse.cpp.

References vpBasicFeature::FEATURE_LINE.

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

◆ select_n11()

unsigned int vpFeatureEllipse::select_n11 ( )
static

Select as visual feature second order centered moments of the ellipse normalized by its area that corresponds to $n_11 = mu_11/a$.

Definition at line 438 of file vpFeatureEllipse.cpp.

References vpBasicFeature::FEATURE_LINE.

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

◆ select_n20()

unsigned int vpFeatureEllipse::select_n20 ( )
static

Select as visual feature second order centered moments of the ellipse normalized by its area that corresponds to $n_20 = mu_20/a$.

Definition at line 433 of file vpFeatureEllipse.cpp.

References vpBasicFeature::FEATURE_LINE.

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

◆ selectAll()

static unsigned int vpBasicFeature::selectAll ( )
inlinestaticinherited

Select all the features.

Examples
testPoint.cpp.

Definition at line 142 of file vpBasicFeature.h.

◆ selectX()

unsigned int vpFeatureEllipse::selectX ( )
static

vpBasicFeature method instantiation

Select as visual feature ellipse centroid coordinate along camera x-axis.

Definition at line 423 of file vpFeatureEllipse.cpp.

References vpBasicFeature::FEATURE_LINE.

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

◆ selectY()

unsigned int vpFeatureEllipse::selectY ( )
static

Select as visual feature ellipse centroid coordinate along camera y-axis.

Definition at line 427 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 315 of file vpFeatureEllipse.cpp.

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

◆ set_xy()

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

Definition at line 327 of file vpFeatureEllipse.cpp.

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

◆ set_y()

void vpFeatureEllipse::set_y ( double  y)

Definition at line 321 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 142 of file vpBasicFeature.cpp.

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

◆ setMoments()

void vpFeatureEllipse::setMoments ( double  n20,
double  n11,
double  n02 
)

Update visual features corresponding to the second order centered moments of the ellipse normalized by its area (i.e., such that $n_{ij} = \mu_{ij}/a$ where $\mu_{ij}$ are the centered moments and a the area).

Parameters
n20,n11,n02Second order centered moments.

Definition at line 350 of file vpFeatureEllipse.cpp.

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

Member Data Documentation

◆ deallocate

◆ dim_s

◆ FEATURE_LINE

BEGIN_VISP_NAMESPACE 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 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(), select_n02(), select_n11(), 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(), selectX(), vpFeaturePoint::selectX(), vpFeaturePoint3D::selectX(), vpFeatureVanishingPoint::selectX(), vpFeatureSegment::selectXc(), selectY(), vpFeaturePoint::selectY(), vpFeaturePoint3D::selectY(), vpFeatureVanishingPoint::selectY(), vpFeatureSegment::selectYc(), and vpFeaturePoint3D::selectZ().

◆ flags

bool* vpBasicFeature::flags
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(), buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureDepth::init(), 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(), 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(), vpFeatureDepth::set_x(), set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureVanishingPoint::set_x(), set_xy(), vpFeaturePoint::set_xyZ(), vpFeaturePoint3D::set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureDepth::set_y(), 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(), setABC(), vpFeatureLine::setABCD(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), vpBasicFeature::setFlags(), setMoments(), 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 vpFeatureLine::buildFrom(), vpFeaturePointPolar::buildFrom(), buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureLuminance::buildFrom(), vpFeatureLuminanceMapping::buildFrom(), display(), vpFeatureMoment::duplicate(), vpFeatureVanishingPoint::error(), vpBasicFeature::error(), vpFeatureDepth::error(), error(), vpFeatureLine::error(), vpFeatureMomentAlpha::error(), vpFeaturePoint::error(), vpFeaturePoint3D::error(), vpFeaturePointPolar::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpGenericFeature::error(), vpFeatureLuminance::error(), vpFeatureLuminanceMapping::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(), 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(), vpFeatureDepth::init(), 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(), interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpFeatureLuminanceMapping::interaction(), vpBasicFeature::operator=(), vpFeatureLuminance::operator=(), vpFeatureLuminanceMapping::operator=(), print(), vpFeatureLine::print(), vpFeatureLuminanceMapping::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(), set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureVanishingPoint::set_x(), set_xy(), set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeatureVanishingPoint::set_y(), vpFeaturePoint3D::set_Z(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), setMoments(), vpFeatureVanishingPoint::setOneOverRho(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), and vpGenericFeature::vpGenericFeature().