ViSP  2.10.0

#include <vpFeatureVanishingPoint.h>

+ Inheritance diagram for vpFeatureVanishingPoint:

Public Types

enum  vpFeatureVanishingPointType { X = 1, Y = 2 }
 
enum  vpBasicFeatureDeallocatorType { user, vpServo }
 

Public Member Functions

void init ()
 
 vpFeatureVanishingPoint ()
 
virtual ~vpFeatureVanishingPoint ()
 
void set_x (const double _x)
 
double get_x () const
 
void set_y (const double _y)
 
double get_y () const
 
void set_xy (const double _x, const double _y)
 
void buildFrom (const double _x, const double _y)
 
vpMatrix interaction (const unsigned int select=FEATURE_ALL)
 
vpColVector error (const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
 
vpColVector error (const unsigned int select=FEATURE_ALL)
 
void print (const unsigned int select=FEATURE_ALL) const
 
vpFeatureVanishingPointduplicate () const
 
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
 
unsigned int dimension_s ()
 
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
 
void setFlags ()
 
void setDeallocate (vpBasicFeatureDeallocatorType d)
 
vpBasicFeatureDeallocatorType getDeallocate ()
 

Static Public Member Functions

static unsigned int selectX ()
 
static unsigned int selectY ()
 
static unsigned int selectAll ()
 

Static Public Attributes

static const unsigned int FEATURE_LINE [32]
 
static const unsigned int FEATURE_ALL = 0xffff
 

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 2D vanishing point visual feature (Z coordinate in 3D space is infinity).

Definition at line 69 of file vpFeatureVanishingPoint.h.

Member Enumeration Documentation

Indicates who should deallocate the feature.

Enumerator
user 
vpServo 

Definition at line 154 of file vpBasicFeature.h.

Enumerator

Definition at line 72 of file vpFeatureVanishingPoint.h.

Constructor & Destructor Documentation

vpFeatureVanishingPoint::vpFeatureVanishingPoint ( )

Default constructor.

Definition at line 80 of file vpFeatureVanishingPoint.cpp.

References init().

Referenced by duplicate().

virtual vpFeatureVanishingPoint::~vpFeatureVanishingPoint ( )
inlinevirtual

Destructor.

Definition at line 90 of file vpFeatureVanishingPoint.h.

Member Function Documentation

void vpFeatureVanishingPoint::buildFrom ( const double  _x,
const double  _y 
)
unsigned int vpBasicFeature::dimension_s ( )
inlineinherited

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

Definition at line 102 of file vpBasicFeature.h.

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

Display vanishing point feature.

Parameters
cam: Camera parameters.
I: Image.
color: Color to use for the display.
thickness: Thickness of the feature representation.

Implements vpBasicFeature.

Definition at line 263 of file vpFeatureVanishingPoint.cpp.

References vpFeatureDisplay::displayPoint(), get_x(), get_y(), and vpERROR_TRACE.

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

Display vanishing point feature.

Parameters
cam: Camera parameters.
I: color Image.
color: Color to use for the display.
thickness: Thickness of the feature representation.

Implements vpBasicFeature.

Definition at line 293 of file vpFeatureVanishingPoint.cpp.

References vpFeatureDisplay::displayPoint(), get_x(), get_y(), and vpERROR_TRACE.

vpFeatureVanishingPoint * vpFeatureVanishingPoint::duplicate ( ) const
virtual

feature duplication

for memory issue (used by the vpServo class only)

Implements vpBasicFeature.

Definition at line 316 of file vpFeatureVanishingPoint.cpp.

References vpFeatureVanishingPoint().

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

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

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

Reimplemented from vpBasicFeature.

Definition at line 192 of file vpFeatureVanishingPoint.cpp.

References vpBasicFeature::s, selectX(), selectY(), vpMatrix::stackMatrices(), and vpERROR_TRACE.

vpColVector vpFeatureVanishingPoint::error ( const unsigned int  select = FEATURE_ALL)

compute the error between a visual features and zero

double vpFeatureVanishingPoint::get_x ( ) const

get the point x-coordinates

Definition at line 95 of file vpFeatureVanishingPoint.cpp.

References vpBasicFeature::s.

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

double vpFeatureVanishingPoint::get_y ( ) const

get the point y-coordinates

Definition at line 109 of file vpFeatureVanishingPoint.cpp.

References vpBasicFeature::s.

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

vpBasicFeatureDeallocatorType vpBasicFeature::getDeallocate ( )
inlineinherited

Definition at line 164 of file vpBasicFeature.h.

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

Get the feature vector dimension.

Definition at line 120 of file vpBasicFeature.cpp.

References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpMatrix::getRows(), and vpBasicFeature::s.

void vpFeatureVanishingPoint::init ( void  )
virtual
vpMatrix vpFeatureVanishingPoint::interaction ( const unsigned int  select = FEATURE_ALL)
virtual

compute the interaction matrix from a subset a the possible features

compute the interaction matrix from a subset of the possible features

Implements vpBasicFeature.

Definition at line 127 of file vpFeatureVanishingPoint.cpp.

References vpBasicFeature::deallocate, vpBasicFeature::flags, get_x(), get_y(), vpBasicFeature::nbParameters, vpBasicFeature::resetFlags(), vpMatrix::resize(), selectX(), selectY(), vpMatrix::stackMatrices(), vpBasicFeature::user, and vpTRACE.

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

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

Definition at line 113 of file vpBasicFeature.h.

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

print the name of the feature

Implements vpBasicFeature.

Definition at line 231 of file vpFeatureVanishingPoint.cpp.

References get_x(), get_y(), selectX(), and selectY().

static unsigned int vpBasicFeature::selectAll ( )
inlinestaticinherited

Select all the features.

Definition at line 116 of file vpBasicFeature.h.

static unsigned int vpFeatureVanishingPoint::selectX ( )
inlinestatic

Definition at line 119 of file vpFeatureVanishingPoint.h.

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

static unsigned int vpFeatureVanishingPoint::selectY ( )
inlinestatic

Definition at line 120 of file vpFeatureVanishingPoint.h.

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

void vpFeatureVanishingPoint::set_x ( const double  _x)

set the point x-coordinates

Definition at line 88 of file vpFeatureVanishingPoint.cpp.

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

Referenced by vpFeatureBuilder::create(), and set_xy().

void vpFeatureVanishingPoint::set_xy ( const double  _x,
const double  _y 
)

set the point xy coordinates

Definition at line 117 of file vpFeatureVanishingPoint.cpp.

References set_x(), and set_y().

void vpFeatureVanishingPoint::set_y ( const double  _y)

set the point y-coordinates

Definition at line 102 of file vpFeatureVanishingPoint.cpp.

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

Referenced by vpFeatureBuilder::create(), and set_xy().

void vpBasicFeature::setDeallocate ( vpBasicFeatureDeallocatorType  d)
inlineinherited

Definition at line 163 of file vpBasicFeature.h.

Referenced by vpServo::addFeature().

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

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

Member Data Documentation

const unsigned int vpBasicFeature::FEATURE_ALL = 0xffff
staticinherited
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 85 of file vpBasicFeature.h.

Referenced by vpBasicFeature::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpGenericFeature::interaction(), vpFeatureMoment::interaction(), vpGenericFeature::print(), and vpFeatureMoment::print().

bool* vpBasicFeature::flags
protectedinherited

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

Definition at line 96 of file vpBasicFeature.h.

Referenced by vpFeatureEllipse::buildFrom(), buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::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(), vpFeatureEllipse::set_x(), 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(), 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(), vpBasicFeature::setFlags(), vpFeatureEllipse::setMu(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpBasicFeature::~vpBasicFeature().

vpColVector vpBasicFeature::s
protectedinherited

State of the visual feature.

Definition at line 91 of file vpBasicFeature.h.

Referenced by vpFeatureEllipse::buildFrom(), vpFeatureLuminance::buildFrom(), buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureEllipse::display(), vpFeatureMoment::duplicate(), vpBasicFeature::error(), vpFeatureEllipse::error(), error(), vpFeatureLuminance::error(), vpFeatureMomentAlpha::error(), vpGenericFeature::error(), vpFeatureDepth::error(), vpFeaturePoint::error(), vpFeatureLine::error(), vpFeaturePoint3D::error(), vpFeaturePointPolar::error(), vpFeatureThetaU::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(), get_x(), vpFeaturePoint::get_x(), vpFeaturePoint3D::get_X(), get_y(), vpFeaturePoint::get_y(), vpFeaturePoint3D::get_Y(), vpFeaturePoint3D::get_Z(), vpBasicFeature::getDimension(), vpFeatureEllipse::init(), init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpGenericFeature::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::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(), set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureEllipse::set_xy(), vpFeatureEllipse::set_y(), set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeaturePoint3D::set_Z(), vpFeatureEllipse::setMu(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), and vpGenericFeature::vpGenericFeature().