Visual Servoing Platform  version 3.2.0
vpFeatureVanishingPoint Class Reference

#include <vpFeatureVanishingPoint.h>

+ Inheritance diagram for vpFeatureVanishingPoint:

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

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 (const unsigned int select=FEATURE_ALL) const
 
virtual double operator[] (const unsigned int i) const
 
void setDeallocate (vpBasicFeatureDeallocatorType d)
 
void setFlags ()
 
static unsigned int selectAll ()
 
vpBasicFeatureDeallocatorType deallocate
 
void resetFlags ()
 

Detailed Description

Class that defines 2D vanishing point visual feature (Z coordinate in 3D space is infinity).

Definition at line 60 of file vpFeatureVanishingPoint.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
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.

◆ vpFeatureVanishingPointType

Enumerator

Definition at line 63 of file vpFeatureVanishingPoint.h.

Constructor & Destructor Documentation

◆ vpFeatureVanishingPoint()

vpFeatureVanishingPoint::vpFeatureVanishingPoint ( )

Default constructor.

Definition at line 73 of file vpFeatureVanishingPoint.cpp.

◆ ~vpFeatureVanishingPoint()

virtual vpFeatureVanishingPoint::~vpFeatureVanishingPoint ( )
inlinevirtual

Destructor.

Definition at line 78 of file vpFeatureVanishingPoint.h.

Member Function Documentation

◆ buildFrom()

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

◆ dimension_s()

unsigned int vpBasicFeature::dimension_s ( )
inlineinherited

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

Definition at line 109 of file vpBasicFeature.h.

◆ display() [1/2]

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 215 of file vpFeatureVanishingPoint.cpp.

◆ display() [2/2]

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 240 of file vpFeatureVanishingPoint.cpp.

◆ duplicate()

vpFeatureVanishingPoint * vpFeatureVanishingPoint::duplicate ( ) const
virtual

feature duplication

for memory issue (used by the vpServo class only)

Implements vpBasicFeature.

Definition at line 258 of file vpFeatureVanishingPoint.cpp.

◆ error() [1/2]

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

compute the error between a visual features and zero

◆ error() [2/2]

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

◆ get_s()

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

Get the feature vector $\bf s$.

Examples
servoAfma6Ellipse2DCamVelocity.cpp.

Definition at line 113 of file vpBasicFeature.cpp.

◆ get_x()

double vpFeatureVanishingPoint::get_x ( ) const

get the point x-coordinates

Definition at line 82 of file vpFeatureVanishingPoint.cpp.

Referenced by print().

◆ get_y()

double vpFeatureVanishingPoint::get_y ( ) const

get the point y-coordinates

Definition at line 91 of file vpFeatureVanishingPoint.cpp.

Referenced by print().

◆ getDeallocate()

vpBasicFeatureDeallocatorType vpBasicFeature::getDeallocate ( )
inlineinherited

Definition at line 122 of file vpBasicFeature.h.

◆ getDimension()

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

Get the feature vector dimension.

Definition at line 99 of file vpBasicFeature.cpp.

◆ init()

void vpFeatureVanishingPoint::init ( void  )
virtual

◆ interaction()

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 101 of file vpFeatureVanishingPoint.cpp.

◆ operator[]()

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

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

Definition at line 129 of file vpBasicFeature.h.

◆ print()

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

print the name of the feature

Implements vpBasicFeature.

Definition at line 186 of file vpFeatureVanishingPoint.cpp.

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

◆ resetFlags()

void vpBasicFeature::resetFlags ( )
protectedinherited

Definition at line 130 of file vpBasicFeature.cpp.

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

◆ selectAll()

static unsigned int vpBasicFeature::selectAll ( )
inlinestaticinherited

Select all the features.

Definition at line 141 of file vpBasicFeature.h.

◆ selectX()

unsigned int vpFeatureVanishingPoint::selectX ( )
static

Definition at line 264 of file vpFeatureVanishingPoint.cpp.

Referenced by print().

◆ selectY()

unsigned int vpFeatureVanishingPoint::selectY ( )
static

Definition at line 265 of file vpFeatureVanishingPoint.cpp.

References vpBasicFeature::FEATURE_LINE.

Referenced by print().

◆ set_x()

void vpFeatureVanishingPoint::set_x ( const double  _x)

Set the point x-coordinates.

set the point x-coordinates

Definition at line 76 of file vpFeatureVanishingPoint.cpp.

◆ set_xy()

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

Set the point xy coordinates.

set the point xy coordinates

Definition at line 94 of file vpFeatureVanishingPoint.cpp.

◆ set_y()

void vpFeatureVanishingPoint::set_y ( const double  _y)

Set the point y-coordinates.

set the point y-coordinates

Definition at line 85 of file vpFeatureVanishingPoint.cpp.

◆ setDeallocate()

void vpBasicFeature::setDeallocate ( vpBasicFeatureDeallocatorType  d)
inlineinherited

Definition at line 136 of file vpBasicFeature.h.

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

Member Data Documentation

◆ deallocate

vpBasicFeatureDeallocatorType vpBasicFeature::deallocate
protectedinherited

Definition at line 147 of file vpBasicFeature.h.

◆ dim_s

unsigned int vpBasicFeature::dim_s
protectedinherited

Dimension of the visual feature.

Definition at line 93 of file vpBasicFeature.h.

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

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

Referenced by vpFeatureEllipse::selectMu02(), vpFeatureEllipse::selectMu11(), vpFeatureEllipse::selectMu20(), selectY(), and vpFeatureEllipse::selectY().

◆ flags

bool* vpBasicFeature::flags
protectedinherited

◆ nbParameters

unsigned int vpBasicFeature::nbParameters
protectedinherited

Number of parameters needed to compute the interaction matrix.

Definition at line 99 of file vpBasicFeature.h.

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

◆ s