44 #include <visp/vpBasicFeature.h>
45 #include <visp/vpFeatureTranslation.h>
47 #include <visp/vpMath.h>
50 #include <visp/vpException.h>
51 #include <visp/vpMatrixException.h>
52 #include <visp/vpFeatureException.h>
55 #include <visp/vpDebug.h>
96 : f2Mf1(), translation(r)
113 : f2Mf1(), translation(r)
130 this->f2Mf1 = f2Mf1_ ;
303 if (
flags[i] ==
false) {
306 vpTRACE(
"Warning !!! The interaction matrix is computed but f2Mf1 was not set yet");
309 vpTRACE(
"Problem during the reading of the variable flags");
316 if (translation ==
cdMc) {
321 for (
int i=0 ; i < 3 ; i++)
322 Lx[0][i] = f2Mf1[0][i] ;
323 Lx[0][3] = 0 ; Lx[0][4] = 0 ; Lx[0][5] = 0 ;
331 for (
int i=0 ; i < 3 ; i++)
332 Ly[0][i] = f2Mf1[1][i] ;
333 Ly[0][3] = 0 ; Ly[0][4] = 0 ; Ly[0][5] = 0 ;
341 for (
int i=0 ; i < 3 ; i++)
342 Lz[0][i] = f2Mf1[2][i] ;
343 Lz[0][3] = 0 ; Lz[0][4] = 0 ; Lz[0][5] = 0 ;
348 if (translation ==
cMcd) {
352 Lx[0][0] = -1 ; Lx[0][1] = 0 ; Lx[0][2] = 0 ;
353 Lx[0][3] = 0 ; Lx[0][4] = -
s[2] ; Lx[0][5] =
s[1] ;
360 Ly[0][0] = 0 ; Ly[0][1] = -1 ; Ly[0][2] = 0 ;
361 Ly[0][3] =
s[2] ; Ly[0][4] = 0 ; Ly[0][5] = -
s[0] ;
368 Lz[0][0] = 0 ; Lz[0][1] = 0 ; Lz[0][2] = -1 ;
369 Lz[0][3] = -
s[1] ; Lz[0][4] =
s[0] ; Lz[0][5] = 0 ;
375 if (translation ==
cMo) {
379 Lx[0][0] = -1 ; Lx[0][1] = 0 ; Lx[0][2] = 0 ;
380 Lx[0][3] = 0 ; Lx[0][4] = -
s[2] ; Lx[0][5] =
s[1] ;
387 Ly[0][0] = 0 ; Ly[0][1] = -1 ; Ly[0][2] = 0 ;
388 Ly[0][3] =
s[2] ; Ly[0][4] = 0 ; Ly[0][5] = -
s[0] ;
395 Lz[0][0] = 0 ; Lz[0][1] = 0 ; Lz[0][2] = -1 ;
396 Lz[0][3] = -
s[1] ; Lz[0][4] =
s[0] ; Lz[0][5] = 0 ;
468 const unsigned int select)
472 if(translation ==
cdMc || translation ==
cMcd)
478 "s* should be zero !")) ;
486 ex[0] =
s[0]-s_star[0] ;
493 ey[0] =
s[1]-s_star[1] ;
500 ez[0] =
s[2]-s_star[2] ;
532 std::cout <<
"Translation 3D: ";
534 std::cout <<
s[0] <<
" ";
537 std::cout <<
s[1] <<
" ";
540 std::cout <<
s[2] <<
" ";
542 std::cout << std::endl;
560 if (translation ==
cdMc)
562 if (translation ==
cMo)
564 if (translation ==
cMcd)
581 static int firsttime =0 ;
602 static int firsttime =0 ;
Definition of the vpMatrix class.
Class that defines the translation visual feature .
bool * flags
Ensure that all the parameters needed to compute the iteraction matrix are set.
void resize(const unsigned int nrows, const unsigned int ncols, const bool nullify=true)
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
Class to define colors available for display functionnalities.
unsigned int dim_s
Dimension of the visual feature.
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const
static unsigned int selectTy()
void set_Ty(const double t_y)
void set_Tx(const double t_x)
vpFeatureTranslation(vpFeatureTranslationRepresentationType r)
vpFeatureTranslationRepresentationType
vpFeatureTranslation * duplicate() const
Feature duplication.
class that defines what is a visual feature
static unsigned int selectTz()
Error that can be emited by the vpBasicFeature class and its derivates.
Generic class defining intrinsic camera parameters.
vpMatrix interaction(const unsigned int select=FEATURE_ALL)
void stackMatrices(const vpMatrix &A)
vpBasicFeatureDeallocatorType deallocate
vpColVector error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
void set_Tz(const double t_z)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
static unsigned int selectTx()
void buildFrom(const vpHomogeneousMatrix &f2Mf1)
vpColVector get_s(unsigned int select=FEATURE_ALL) const
Get the feature vector .
unsigned int nbParameters
Number of parameters needed to compute the interaction matrix.
vpColVector s
State of the visual feature.
void print(const unsigned int select=FEATURE_ALL) const
void resize(const unsigned int i, const bool flagNullify=true)