Visual Servoing Platform  version 3.6.1 under development (2024-12-03)
vpFeatureLuminanceMapping Class Reference

#include <visp3/visual_features/vpFeatureLuminanceMapping.h>

+ Inheritance diagram for vpFeatureLuminanceMapping:

Public Types

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

Public Member Functions

 vpFeatureLuminanceMapping (const vpCameraParameters &cam, unsigned int h, unsigned int w, double Z, const std::shared_ptr< vpLuminanceMapping > mapping)
 
 vpFeatureLuminanceMapping (const vpFeatureLuminance &luminance, std::shared_ptr< vpLuminanceMapping > mapping)
 
void init () VP_OVERRIDE
 
void init (const vpCameraParameters &cam, unsigned int h, unsigned int w, double Z, std::shared_ptr< vpLuminanceMapping > mapping)
 
void init (const vpFeatureLuminance &luminance, std::shared_ptr< vpLuminanceMapping > mapping)
 
 vpFeatureLuminanceMapping (const vpFeatureLuminanceMapping &f)
 
vpFeatureLuminanceMappingoperator= (const vpFeatureLuminanceMapping &f)
 
vpFeatureLuminanceMappingduplicate () const VP_OVERRIDE
 
virtual ~vpFeatureLuminanceMapping ()=default
 
void buildFrom (vpImage< unsigned char > &I)
 
void display (const vpCameraParameters &, const vpImage< unsigned char > &, const vpColor &=vpColor::green, unsigned int=1) const VP_OVERRIDE
 
void display (const vpCameraParameters &, const vpImage< vpRGBa > &, const vpColor &=vpColor::green, unsigned int=1) const VP_OVERRIDE
 
vpColVector error (const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) VP_OVERRIDE
 
void error (const vpBasicFeature &s_star, vpColVector &e)
 
vpMatrix interaction (unsigned int select=FEATURE_ALL) VP_OVERRIDE
 
void interaction (vpMatrix &L)
 
void print (unsigned int select=FEATURE_ALL) const VP_OVERRIDE
 
vpFeatureLuminancegetLuminanceFeature ()
 
std::shared_ptr< vpLuminanceMapping > & getMapping ()
 

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

Detailed Description

Class to combine luminance features (photometric servoing)

with a mapping $ f(\mathbf{I}) $ that projects an image to a low dimensional representation $ \mathbf{s} $ (see vpLuminanceMapping::map). The interaction matrix of $ \mathbf{s} $ is computed as a function of $ \mathbf{I}, \mathbf{L_I} $ (see vpLuminanceMapping::interaction)

The mapping $ f $ is applied to the center crop of the image, where the interaction matrix of the pixels can be computed (see vpFeatureLuminance::getBorder).

See also
vpLuminanceDCT, vpLuminancePCA, vpFeatureLuminance
Examples
photometricMappingVisualServoing.cpp.

Definition at line 387 of file vpFeatureLuminanceMapping.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

◆ vpFeatureLuminanceMapping() [1/3]

vpFeatureLuminanceMapping::vpFeatureLuminanceMapping ( const vpCameraParameters cam,
unsigned int  h,
unsigned int  w,
double  Z,
const std::shared_ptr< vpLuminanceMapping mapping 
)

Definition at line 500 of file vpFeatureLuminanceMapping.cpp.

References init().

Referenced by duplicate().

◆ vpFeatureLuminanceMapping() [2/3]

vpFeatureLuminanceMapping::vpFeatureLuminanceMapping ( const vpFeatureLuminance luminance,
std::shared_ptr< vpLuminanceMapping mapping 
)

Definition at line 506 of file vpFeatureLuminanceMapping.cpp.

References init().

◆ vpFeatureLuminanceMapping() [3/3]

vpFeatureLuminanceMapping::vpFeatureLuminanceMapping ( const vpFeatureLuminanceMapping f)

Definition at line 510 of file vpFeatureLuminanceMapping.cpp.

◆ ~vpFeatureLuminanceMapping()

virtual vpFeatureLuminanceMapping::~vpFeatureLuminanceMapping ( )
virtualdefault

Member Function Documentation

◆ buildFrom()

void vpFeatureLuminanceMapping::buildFrom ( vpImage< unsigned char > &  I)

◆ 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 vpFeatureLuminanceMapping::display ( const vpCameraParameters ,
const vpImage< unsigned char > &  ,
const vpColor = vpColor::green,
unsigned int  = 1 
) const
inlinevirtual

Implements vpBasicFeature.

Definition at line 404 of file vpFeatureLuminanceMapping.h.

◆ display() [2/2]

void vpFeatureLuminanceMapping::display ( const vpCameraParameters ,
const vpImage< vpRGBa > &  ,
const vpColor = vpColor::green,
unsigned int  = 1 
) const
inlinevirtual

Implements vpBasicFeature.

Definition at line 407 of file vpFeatureLuminanceMapping.h.

◆ duplicate()

vpFeatureLuminanceMapping * vpFeatureLuminanceMapping::duplicate ( ) const
virtual

Implements vpBasicFeature.

Definition at line 550 of file vpFeatureLuminanceMapping.cpp.

References vpFeatureLuminanceMapping().

◆ error() [1/2]

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

Compute the error between two visual features from a subset of the possible features.

Reimplemented from vpBasicFeature.

Definition at line 562 of file vpFeatureLuminanceMapping.cpp.

References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_ALL, and vpException::notImplementedError.

◆ error() [2/2]

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

◆ get_s()

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

◆ getLuminanceFeature()

vpFeatureLuminance& vpFeatureLuminanceMapping::getLuminanceFeature ( )
inline

Definition at line 419 of file vpFeatureLuminanceMapping.h.

◆ getMapping()

std::shared_ptr<vpLuminanceMapping>& vpFeatureLuminanceMapping::getMapping ( )
inline

Definition at line 420 of file vpFeatureLuminanceMapping.h.

◆ init() [1/3]

void vpFeatureLuminanceMapping::init ( void  )
virtual

◆ init() [2/3]

void vpFeatureLuminanceMapping::init ( const vpCameraParameters cam,
unsigned int  h,
unsigned int  w,
double  Z,
std::shared_ptr< vpLuminanceMapping mapping 
)

◆ init() [3/3]

void vpFeatureLuminanceMapping::init ( const vpFeatureLuminance luminance,
std::shared_ptr< vpLuminanceMapping mapping 
)

◆ interaction() [1/2]

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

Compute the interaction matrix from a subset of the possible features.

Implements vpBasicFeature.

Definition at line 580 of file vpFeatureLuminanceMapping.cpp.

References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_ALL, and vpException::notImplementedError.

◆ interaction() [2/2]

void vpFeatureLuminanceMapping::interaction ( vpMatrix L)

◆ operator=()

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

Definition at line 542 of file vpFeatureLuminanceMapping.cpp.

References vpBasicFeature::dim_s, and vpBasicFeature::s.

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

Print the name of the feature.

Implements vpBasicFeature.

Definition at line 596 of file vpFeatureLuminanceMapping.cpp.

References vpBasicFeature::s.

◆ resetFlags()

◆ selectAll()

static unsigned int vpBasicFeature::selectAll ( )
inlinestaticinherited

Select all the features.

Examples
testPoint.cpp.

Definition at line 142 of file vpBasicFeature.h.

◆ 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

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

◆ 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(), vpFeatureLuminance::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(), vpFeatureLuminance::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::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(), vpFeatureEllipse::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureLuminance::buildFrom(), 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(), vpFeatureLuminance::error(), 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(), init(), vpFeatureLuminance::init(), vpFeatureMoment::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), interaction(), vpBasicFeature::operator=(), vpFeatureLuminance::operator=(), operator=(), vpFeatureEllipse::print(), vpFeatureLine::print(), 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().