Visual Servoing Platform  version 3.6.1 under development (2024-12-17)

#include <visp3/visual_features/vpFeatureLuminanceMapping.h>

+ Inheritance diagram for vpLuminanceDCT:

Classes

class  vpMatrixZigZagIndex
 

Public Member Functions

 vpLuminanceDCT (const unsigned int k)
 
void init (const unsigned int k)
 
 vpLuminanceDCT (const vpLuminanceDCT &other)
 
vpLuminanceDCToperator= (const vpLuminanceDCT &)=default
 
void map (const vpImage< unsigned char > &I, vpColVector &s) VP_OVERRIDE
 
void inverse (const vpColVector &s, vpImage< unsigned char > &I) VP_OVERRIDE
 
void interaction (const vpImage< unsigned char > &I, const vpMatrix &LI, const vpColVector &s, vpMatrix &L) VP_OVERRIDE
 
unsigned int getProjectionSize () const
 
unsigned int getBorder () const
 
void setBorder (unsigned border)
 

Static Public Member Functions

static void imageAsVector (const vpImage< unsigned char > &I, vpColVector &Ivec, unsigned border)
 
static void imageAsMatrix (const vpImage< unsigned char > &I, vpMatrix &Imat, unsigned border)
 

Protected Attributes

unsigned int m_Ih
 
unsigned int m_Iw
 
vpMatrix m_Imat
 
vpMatrix m_dct
 
vpMatrix m_Dcols
 
vpMatrix m_Drows
 
std::array< vpMatrix, 6 > m_dIdrPlanes
 
vpLuminanceDCT::vpMatrixZigZagIndex m_zigzag
 
unsigned m_mappingSize
 
unsigned m_border
 

Detailed Description

Implementation of [36].

Computes the Discrete Cosine Transform (DCT) representation of the image. Only the K first components are preserved and stored into a vector when calling map. These components correspond to the lowest frequencies of the input image.

Examples
catchLuminanceMapping.cpp, and photometricMappingVisualServoing.cpp.

Definition at line 286 of file vpFeatureLuminanceMapping.h.

Constructor & Destructor Documentation

◆ vpLuminanceDCT() [1/2]

vpLuminanceDCT::vpLuminanceDCT ( const unsigned int  k)
inline

Build a new DCT object.

Parameters
kthe number of components to keep from the DCT matrix and use as servoing features

Definition at line 335 of file vpFeatureLuminanceMapping.h.

◆ vpLuminanceDCT() [2/2]

vpLuminanceDCT::vpLuminanceDCT ( const vpLuminanceDCT other)

Copy constructor.

Definition at line 426 of file vpFeatureLuminanceMapping.cpp.

Member Function Documentation

◆ getBorder()

unsigned int vpLuminanceMapping::getBorder ( ) const
inlineinherited

Returns the number of pixels that are removed by the photometric VS computation.

Returns
space size
Examples
catchLuminanceMapping.cpp.

Definition at line 114 of file vpFeatureLuminanceMapping.h.

◆ getProjectionSize()

unsigned int vpLuminanceMapping::getProjectionSize ( ) const
inlineinherited

Returns the size of the space to which an image is mapped to.

Returns
space size
Examples
catchLuminanceMapping.cpp.

Definition at line 107 of file vpFeatureLuminanceMapping.h.

◆ imageAsMatrix()

void vpLuminanceMapping::imageAsMatrix ( const vpImage< unsigned char > &  I,
vpMatrix Imat,
unsigned  border 
)
staticinherited

◆ imageAsVector()

BEGIN_VISP_NAMESPACE void vpLuminanceMapping::imageAsVector ( const vpImage< unsigned char > &  I,
vpColVector Ivec,
unsigned  border 
)
staticinherited

◆ init()

void vpLuminanceDCT::init ( const unsigned int  k)
inline

Initialize the DCT object with the number of required components.

Definition at line 343 of file vpFeatureLuminanceMapping.h.

References vpFeatureLuminance::DEFAULT_BORDER.

◆ interaction()

void vpLuminanceDCT::interaction ( const vpImage< unsigned char > &  I,
const vpMatrix LI,
const vpColVector s,
vpMatrix L 
)
virtual

Compute the interaction matrix associated with the representation s.

Parameters
Iinput image used to compute s
LIPhotometric interaction matrix associated to I (see vpFeatureLuminance)
sthe already computed representation
LThe output interaction matrix, of dimensions getProjectionSize() x 6

Implements vpLuminanceMapping.

Definition at line 478 of file vpFeatureLuminanceMapping.cpp.

References vpLuminanceDCT::vpMatrixZigZagIndex::getValues(), m_Dcols, m_dIdrPlanes, m_Drows, m_Ih, m_Iw, vpLuminanceMapping::m_mappingSize, m_zigzag, and vpMatrix::t().

◆ inverse()

void vpLuminanceDCT::inverse ( const vpColVector s,
vpImage< unsigned char > &  I 
)
virtual

◆ map()

void vpLuminanceDCT::map ( const vpImage< unsigned char > &  I,
vpColVector s 
)
virtual

Map an image I to a representation s. This representation s has getProjectionSize() rows.

Note that when combined with vpFeatureLuminanceMapping, The image I does not have the same size as the image input of vpFeatureLuminanceMapping::build. I is the center crop of this image.

Parameters
IThe input image
sThe resulting representation that will serve as visual servoing features.

Implements vpLuminanceMapping.

Definition at line 431 of file vpFeatureLuminanceMapping.cpp.

References vpArray2D< Type >::getCols(), vpImage< Type >::getHeight(), vpArray2D< Type >::getRows(), vpLuminanceDCT::vpMatrixZigZagIndex::getValues(), vpImage< Type >::getWidth(), vpLuminanceMapping::imageAsMatrix(), vpLuminanceDCT::vpMatrixZigZagIndex::init(), vpLuminanceMapping::m_border, m_Dcols, m_dct, m_Drows, m_Ih, m_Imat, m_Iw, vpLuminanceMapping::m_mappingSize, and m_zigzag.

◆ operator=()

vpLuminanceDCT& vpLuminanceDCT::operator= ( const vpLuminanceDCT )
default

◆ setBorder()

void vpLuminanceMapping::setBorder ( unsigned  border)
inlineinherited

Set the number of pixels that are removed by the photometric VS computation This function should be called by vpFeatureLuminanceMapping.

Parameters
border
Examples
catchLuminanceMapping.cpp.

Definition at line 122 of file vpFeatureLuminanceMapping.h.

Member Data Documentation

◆ m_border

unsigned vpLuminanceMapping::m_border
protectedinherited

Final vector size.

Definition at line 129 of file vpFeatureLuminanceMapping.h.

Referenced by vpLuminancePCA::init(), vpLuminancePCA::map(), map(), and vpLuminancePCA::operator=().

◆ m_Dcols

vpMatrix vpLuminanceDCT::m_Dcols
protected

DCT representation of the image.

Definition at line 369 of file vpFeatureLuminanceMapping.h.

Referenced by interaction(), inverse(), and map().

◆ m_dct

vpMatrix vpLuminanceDCT::m_dct
protected

Image as a matrix.

Definition at line 368 of file vpFeatureLuminanceMapping.h.

Referenced by inverse(), and map().

◆ m_dIdrPlanes

std::array<vpMatrix, 6> vpLuminanceDCT::m_dIdrPlanes
protected

the computed DCT matrices. The separable property of DCt is used so that a 1D DCT is computed on rows and another on columns of the result of the first dct;

Definition at line 370 of file vpFeatureLuminanceMapping.h.

Referenced by interaction().

◆ m_Drows

vpMatrix vpLuminanceDCT::m_Drows
protected

Definition at line 369 of file vpFeatureLuminanceMapping.h.

Referenced by interaction(), inverse(), and map().

◆ m_Ih

unsigned int vpLuminanceDCT::m_Ih
protected

Definition at line 366 of file vpFeatureLuminanceMapping.h.

Referenced by interaction(), and map().

◆ m_Imat

vpMatrix vpLuminanceDCT::m_Imat
protected

image dimensions (without borders)

Definition at line 367 of file vpFeatureLuminanceMapping.h.

Referenced by map().

◆ m_Iw

unsigned int vpLuminanceDCT::m_Iw
protected

Definition at line 366 of file vpFeatureLuminanceMapping.h.

Referenced by interaction(), and map().

◆ m_mappingSize

unsigned vpLuminanceMapping::m_mappingSize
protectedinherited

◆ m_zigzag

vpLuminanceDCT::vpMatrixZigZagIndex vpLuminanceDCT::m_zigzag
protected

Luminance interaction matrix, seen as six image planes.

Definition at line 371 of file vpFeatureLuminanceMapping.h.

Referenced by interaction(), inverse(), and map().