Visual Servoing Platform  version 3.6.1 under development (2024-11-14)
vpFeatureLuminance Class Reference

#include <visp3/visual_features/vpFeatureLuminance.h>

+ Inheritance diagram for vpFeatureLuminance:

Public Types

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

Public Member Functions

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

Public Attributes

vpCameraParameters cam
 

Static Public Attributes

static const int DEFAULT_BORDER = 10
 
static const unsigned int FEATURE_LINE [32]
 

Protected Attributes

double Z
 
unsigned int nbr
 
unsigned int nbc
 
unsigned int bord
 
vpLuminance * pixInfo
 
int firstTimeIn
 
vpColVector s
 
unsigned int dim_s
 
bool * flags
 
unsigned int nbParameters
 

Inherited functionalities from vpBasicFeature

vpBasicFeatureDeallocatorType deallocate
 
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 ()
 
void resetFlags ()
 

Detailed Description

Class that defines the image luminance visual feature.

For more details see [7].

Examples
photometricMappingVisualServoing.cpp, photometricVisualServoing.cpp, and photometricVisualServoingWithoutVpServo.cpp.

Definition at line 74 of file vpFeatureLuminance.h.

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

◆ vpFeatureLuminance() [1/2]

vpFeatureLuminance::vpFeatureLuminance ( )

Default constructor that build a visual feature.

Definition at line 101 of file vpFeatureLuminance.cpp.

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

Referenced by duplicate().

◆ vpFeatureLuminance() [2/2]

vpFeatureLuminance::vpFeatureLuminance ( const vpFeatureLuminance f)

Copy constructor.

Definition at line 116 of file vpFeatureLuminance.cpp.

◆ ~vpFeatureLuminance()

vpFeatureLuminance::~vpFeatureLuminance ( )
virtual

Destructor.

Destructor that free allocated memory.

Definition at line 146 of file vpFeatureLuminance.cpp.

References pixInfo.

Member Function Documentation

◆ buildFrom()

◆ 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 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 320 of file vpFeatureLuminance.cpp.

◆ display() [2/2]

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 338 of file vpFeatureLuminance.cpp.

◆ duplicate()

vpFeatureLuminance * vpFeatureLuminance::duplicate ( ) const
virtual

Create an object with the same type.

s_star = s.duplicate(); // s_star is now a vpFeatureLuminance
class that defines what is a visual feature
vpColVector s
State of the visual feature.
Class that defines the image luminance visual feature.

Implements vpBasicFeature.

Definition at line 361 of file vpFeatureLuminance.cpp.

References vpFeatureLuminance().

◆ error() [1/2]

vpColVector vpFeatureLuminance::error ( const vpBasicFeature s_star,
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
photometricVisualServoingWithoutVpServo.cpp.

Definition at line 288 of file vpFeatureLuminance.cpp.

◆ error() [2/2]

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 272 of file vpFeatureLuminance.cpp.

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

◆ get_s()

◆ get_Z()

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 171 of file vpFeatureLuminance.cpp.

References Z.

◆ getBorder()

unsigned int vpFeatureLuminance::getBorder ( ) const

Definition at line 172 of file vpFeatureLuminance.cpp.

References bord.

Referenced by vpFeatureLuminanceMapping::init().

◆ 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() [1/2]

void vpFeatureLuminance::init ( void  )
virtual

Initialize the memory space requested for vpFeatureLuminance visual feature.

Implements vpBasicFeature.

Definition at line 59 of file vpFeatureLuminance.cpp.

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

Referenced by init(), and vpFeatureLuminance().

◆ init() [2/2]

void vpFeatureLuminance::init ( unsigned int  _nbr,
unsigned int  _nbc,
double  _Z 
)

◆ interaction() [1/2]

vpMatrix vpFeatureLuminance::interaction ( 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
photometricVisualServoingWithoutVpServo.cpp.

Definition at line 257 of file vpFeatureLuminance.cpp.

Referenced by vpFeatureLuminanceMapping::buildFrom(), and vpFeatureLuminanceMapping::interaction().

◆ interaction() [2/2]

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 230 of file vpFeatureLuminance.cpp.

References vpBasicFeature::dim_s, and pixInfo.

◆ operator=()

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

Copy operator.

Definition at line 125 of file vpFeatureLuminance.cpp.

References bord, cam, vpBasicFeature::dim_s, firstTimeIn, nbc, nbr, pixInfo, vpColVector::resize(), vpBasicFeature::s, and Z.

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

Not implemented.

Implements vpBasicFeature.

Definition at line 303 of file vpFeatureLuminance.cpp.

◆ resetFlags()

◆ selectAll()

static unsigned int vpBasicFeature::selectAll ( )
inlinestaticinherited

Select all the features.

Examples
testPoint.cpp.

Definition at line 142 of file vpBasicFeature.h.

◆ set_Z()

void vpFeatureLuminance::set_Z ( 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 159 of file vpFeatureLuminance.cpp.

References vpBasicFeature::flags, and Z.

◆ setCameraParameters()

void vpFeatureLuminance::setCameraParameters ( const vpCameraParameters _cam)

◆ 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.

Member Data Documentation

◆ bord

unsigned int vpFeatureLuminance::bord
protected

Border size.

Definition at line 86 of file vpFeatureLuminance.h.

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

◆ cam

vpCameraParameters vpFeatureLuminance::cam

Definition at line 131 of file vpFeatureLuminance.h.

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

◆ deallocate

◆ DEFAULT_BORDER

BEGIN_VISP_NAMESPACE const int vpFeatureLuminance::DEFAULT_BORDER = 10
static

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

◆ firstTimeIn

int vpFeatureLuminance::firstTimeIn
protected

Definition at line 90 of file vpFeatureLuminance.h.

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

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

◆ nbc

unsigned int vpFeatureLuminance::nbc
protected

Number of column.

Definition at line 84 of file vpFeatureLuminance.h.

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

◆ nbParameters

◆ nbr

unsigned int vpFeatureLuminance::nbr
protected

Number of rows.

Definition at line 82 of file vpFeatureLuminance.h.

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

◆ pixInfo

vpLuminance* vpFeatureLuminance::pixInfo
protected

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

Definition at line 89 of file vpFeatureLuminance.h.

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

◆ s

vpColVector vpBasicFeature::s
protectedinherited

State of the visual feature.

Definition at line 92 of file vpBasicFeature.h.

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

◆ Z

double vpFeatureLuminance::Z
protected

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

Definition at line 79 of file vpFeatureLuminance.h.

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