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>
132 this->f2Mf1 = f2Mf1 ;
305 if (
flags[i] ==
false) {
308 vpTRACE(
"Warning !!! The interaction matrix is computed but f2Mf1 was not set yet");
311 vpTRACE(
"Problem during the reading of the variable flags");
318 if (translation ==
cdMc) {
323 for (
int i=0 ; i < 3 ; i++)
324 Lx[0][i] = f2Mf1[0][i] ;
325 Lx[0][3] = 0 ; Lx[0][4] = 0 ; Lx[0][5] = 0 ;
333 for (
int i=0 ; i < 3 ; i++)
334 Ly[0][i] = f2Mf1[1][i] ;
335 Ly[0][3] = 0 ; Ly[0][4] = 0 ; Ly[0][5] = 0 ;
343 for (
int i=0 ; i < 3 ; i++)
344 Lz[0][i] = f2Mf1[2][i] ;
345 Lz[0][3] = 0 ; Lz[0][4] = 0 ; Lz[0][5] = 0 ;
350 if (translation ==
cMcd) {
354 Lx[0][0] = -1 ; Lx[0][1] = 0 ; Lx[0][2] = 0 ;
355 Lx[0][3] = 0 ; Lx[0][4] = -
s[2] ; Lx[0][5] =
s[1] ;
362 Ly[0][0] = 0 ; Ly[0][1] = -1 ; Ly[0][2] = 0 ;
363 Ly[0][3] =
s[2] ; Ly[0][4] = 0 ; Ly[0][5] = -
s[0] ;
370 Lz[0][0] = 0 ; Lz[0][1] = 0 ; Lz[0][2] = -1 ;
371 Lz[0][3] = -
s[1] ; Lz[0][4] =
s[0] ; Lz[0][5] = 0 ;
377 if (translation ==
cMo) {
381 Lx[0][0] = -1 ; Lx[0][1] = 0 ; Lx[0][2] = 0 ;
382 Lx[0][3] = 0 ; Lx[0][4] = -
s[2] ; Lx[0][5] =
s[1] ;
389 Ly[0][0] = 0 ; Ly[0][1] = -1 ; Ly[0][2] = 0 ;
390 Ly[0][3] =
s[2] ; Ly[0][4] = 0 ; Ly[0][5] = -
s[0] ;
397 Lz[0][0] = 0 ; Lz[0][1] = 0 ; Lz[0][2] = -1 ;
398 Lz[0][3] = -
s[1] ; Lz[0][4] =
s[0] ; Lz[0][5] = 0 ;
470 const unsigned int select)
474 if(translation ==
cdMc || translation ==
cMcd)
480 "s* should be zero !")) ;
488 ex[0] =
s[0]-s_star[0] ;
495 ey[0] =
s[1]-s_star[1] ;
502 ez[0] =
s[2]-s_star[2] ;
534 std::cout <<
"Translation 3D: ";
536 std::cout <<
s[0] <<
" ";
539 std::cout <<
s[1] <<
" ";
542 std::cout <<
s[2] <<
" ";
544 std::cout << std::endl;
562 if (translation ==
cdMc)
564 if (translation ==
cMo)
566 if (translation ==
cMcd)
583 static int firsttime =0 ;
604 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()
double sumSquare() const
return sum of the Aij^2 (for all i, for all j)
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)
static vpMatrix stackMatrices(const vpMatrix &A, const vpMatrix &B)
Stack two Matrices C = [ A B ]^T.
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)