ViSP  2.10.0
vpFeatureLuminance Class Reference

#include <vpFeatureLuminance.h>

+ Inheritance diagram for vpFeatureLuminance:

Public Types

enum  vpBasicFeatureDeallocatorType { user, vpServo }
 

Public Member Functions

void buildFrom (vpImage< unsigned char > &I)
 
void init ()
 
void init (unsigned int _nbr, unsigned int _nbc, double _Z)
 
 vpFeatureLuminance ()
 
 vpFeatureLuminance (const vpFeatureLuminance &f)
 
vpFeatureLuminanceoperator= (const vpFeatureLuminance &f)
 
virtual ~vpFeatureLuminance ()
 
void setCameraParameters (vpCameraParameters &_cam)
 
void set_Z (const double Z)
 
double get_Z () const
 
vpMatrix interaction (const unsigned int select=FEATURE_ALL)
 
void interaction (vpMatrix &L)
 
vpColVector error (const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
 
void error (const vpBasicFeature &s_star, vpColVector &e)
 
void print (const unsigned int select=FEATURE_ALL) const
 
vpFeatureLuminanceduplicate () 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
 
vpColVector error (const unsigned int select=FEATURE_ALL)
 
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 selectAll ()
 

Public Attributes

vpCameraParameters cam
 

Static Public Attributes

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

Protected Member Functions

void resetFlags ()
 

Protected Attributes

double Z
 
unsigned int nbr
 
unsigned int nbc
 
unsigned int bord
 
vpLuminancepixInfo
 
int firstTimeIn
 
vpColVector s
 
unsigned int dim_s
 
bool * flags
 
unsigned int nbParameters
 
vpBasicFeatureDeallocatorType deallocate
 

Detailed Description

Class that defines the image luminance visual feature.

For more details see [6].

Examples:
photometricVisualServoing.cpp.

Definition at line 84 of file vpFeatureLuminance.h.

Member Enumeration Documentation

Indicates who should deallocate the feature.

Enumerator
user 
vpServo 

Definition at line 154 of file vpBasicFeature.h.

Constructor & Destructor Documentation

vpFeatureLuminance::vpFeatureLuminance ( )

Default constructor that build a visual feature.

Definition at line 70 of file vpFeatureLuminance.cpp.

References vpBasicFeature::dim_s, vpBasicFeature::flags, init(), and vpBasicFeature::nbParameters.

Referenced by duplicate().

vpFeatureLuminance::vpFeatureLuminance ( const vpFeatureLuminance f)

Copy constructor.

Definition at line 83 of file vpFeatureLuminance.cpp.

vpFeatureLuminance::~vpFeatureLuminance ( )
virtual

Destructor.

Destructor that free allocated memory.

Definition at line 111 of file vpFeatureLuminance.cpp.

References pixInfo.

Member Function Documentation

unsigned int vpBasicFeature::dimension_s ( )
inlineinherited

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

Definition at line 102 of file vpBasicFeature.h.

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

Not implemented.

Implements vpBasicFeature.

Definition at line 326 of file vpFeatureLuminance.cpp.

References vpERROR_TRACE.

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

Not implemented.

Implements vpBasicFeature.

Definition at line 348 of file vpFeatureLuminance.cpp.

References vpERROR_TRACE.

vpFeatureLuminance * vpFeatureLuminance::duplicate ( ) const
virtual

Create an object with the same type.

s_star = s.duplicate(); // s_star is now a vpFeatureLuminance

Implements vpBasicFeature.

Definition at line 375 of file vpFeatureLuminance.cpp.

References vpFeatureLuminance().

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

Compute the error $ (I-I^*)$ between the current and the desired

Parameters
s_star: Desired visual feature.
select: Not used.

Reimplemented from vpBasicFeature.

Examples:
photometricVisualServoing.cpp.

Definition at line 285 of file vpFeatureLuminance.cpp.

void vpFeatureLuminance::error ( const vpBasicFeature s_star,
vpColVector e 
)

Compute the error $ (I-I^*)$ between the current and the desired

Parameters
s_star: Desired visual feature.
e: Error between the current and the desired features.

Definition at line 264 of file vpFeatureLuminance.cpp.

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

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

Compute the error between a visual features and zero.

double vpFeatureLuminance::get_Z ( ) const

Get the value of $ Z $ which represents the depth in the 3D camera frame.

Returns
The value of $ Z $.

Definition at line 135 of file vpFeatureLuminance.cpp.

References Z.

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 vpFeatureLuminance::init ( void  )
virtual

Initialize the memory space requested for vpFeatureLuminance visual feature.

Implements vpBasicFeature.

Examples:
photometricVisualServoing.cpp.

Definition at line 27 of file vpFeatureLuminance.cpp.

References firstTimeIn, vpBasicFeature::flags, nbc, vpBasicFeature::nbParameters, nbr, and Z.

Referenced by init(), and vpFeatureLuminance().

void vpFeatureLuminance::init ( unsigned int  _nbr,
unsigned int  _nbc,
double  _Z 
)
vpMatrix vpFeatureLuminance::interaction ( const unsigned int  select = FEATURE_ALL)
virtual

Compute and return the interaction matrix $ L_I $. The computation is made thanks to the values of the luminance features $ I $

Implements vpBasicFeature.

Examples:
photometricVisualServoing.cpp.

Definition at line 248 of file vpFeatureLuminance.cpp.

void vpFeatureLuminance::interaction ( vpMatrix L)

Compute and return the interaction matrix $ L_I $. The computation is made thanks to the values of the luminance features $ I $

Definition at line 218 of file vpFeatureLuminance.cpp.

References vpBasicFeature::dim_s, vpMatrix::getRows(), vpLuminance::Ix, vpLuminance::Iy, pixInfo, vpMatrix::resize(), vpLuminance::x, vpLuminance::y, and vpLuminance::Z.

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

Copy operator.

Definition at line 92 of file vpFeatureLuminance.cpp.

References bord, cam, vpBasicFeature::dim_s, firstTimeIn, nbc, nbr, pixInfo, and Z.

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 vpFeatureLuminance::print ( const unsigned int  select = FEATURE_ALL) const
virtual

Not implemented.

Implements vpBasicFeature.

Definition at line 305 of file vpFeatureLuminance.cpp.

References vpERROR_TRACE.

static unsigned int vpBasicFeature::selectAll ( )
inlinestaticinherited

Select all the features.

Definition at line 116 of file vpBasicFeature.h.

void vpFeatureLuminance::set_Z ( const double  Z_)

Set the value of $ Z $ which represents the depth in the 3D camera frame.

Parameters
Z_: $ Z $ value to set.

Definition at line 122 of file vpFeatureLuminance.cpp.

References vpBasicFeature::flags, and Z.

void vpFeatureLuminance::setCameraParameters ( vpCameraParameters _cam)
Examples:
photometricVisualServoing.cpp.

Definition at line 142 of file vpFeatureLuminance.cpp.

References cam.

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

unsigned int vpFeatureLuminance::bord
protected

Border size.

Definition at line 96 of file vpFeatureLuminance.h.

Referenced by buildFrom(), init(), and operator=().

vpCameraParameters vpFeatureLuminance::cam

Definition at line 118 of file vpFeatureLuminance.h.

Referenced by buildFrom(), operator=(), and setCameraParameters().

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().

int vpFeatureLuminance::firstTimeIn
protected

Definition at line 100 of file vpFeatureLuminance.h.

Referenced by buildFrom(), init(), and operator=().

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(), vpFeatureVanishingPoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeatureMoment::init(), vpFeaturePoint::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::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(), vpFeatureVanishingPoint::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(), vpFeatureVanishingPoint::set_y(), vpFeatureDepth::set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), 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(), and vpBasicFeature::~vpBasicFeature().

unsigned int vpFeatureLuminance::nbc
protected

Number of column.

Definition at line 94 of file vpFeatureLuminance.h.

Referenced by buildFrom(), init(), and operator=().

unsigned int vpFeatureLuminance::nbr
protected

Number of rows.

Definition at line 92 of file vpFeatureLuminance.h.

Referenced by buildFrom(), init(), and operator=().

vpLuminance* vpFeatureLuminance::pixInfo
protected

Store the image (as a vector with intensity and gradient I, Ix, Iy)

Definition at line 99 of file vpFeatureLuminance.h.

Referenced by buildFrom(), init(), interaction(), operator=(), and ~vpFeatureLuminance().

vpColVector vpBasicFeature::s
protectedinherited

State of the visual feature.

Definition at line 91 of file vpBasicFeature.h.

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

double vpFeatureLuminance::Z
protected

FeaturePoint depth (required to compute the interaction matrix) default Z = 1m

Definition at line 89 of file vpFeatureLuminance.h.

Referenced by buildFrom(), get_Z(), init(), operator=(), and set_Z().