40 #include <visp3/visual_features/vpBasicFeature.h>
41 #include <visp3/visual_features/vpFeatureTranslation.h>
43 #include <visp3/core/vpMath.h>
46 #include <visp3/core/vpException.h>
47 #include <visp3/visual_features/vpFeatureException.h>
50 #include <visp3/core/vpDebug.h>
104 : f2Mf1(), translation(r)
121 : f2Mf1(), translation(r)
138 this->f2Mf1 = f2Mf1_ ;
340 if (
flags[i] ==
false) {
343 vpTRACE(
"Warning !!! The interaction matrix is computed but f2Mf1 was not set yet");
346 vpTRACE(
"Problem during the reading of the variable flags");
353 if (translation ==
cdMc) {
358 for (
int i=0 ; i < 3 ; i++)
359 Lx[0][i] = f2Mf1[0][i] ;
360 Lx[0][3] = 0 ; Lx[0][4] = 0 ; Lx[0][5] = 0 ;
368 for (
int i=0 ; i < 3 ; i++)
369 Ly[0][i] = f2Mf1[1][i] ;
370 Ly[0][3] = 0 ; Ly[0][4] = 0 ; Ly[0][5] = 0 ;
378 for (
int i=0 ; i < 3 ; i++)
379 Lz[0][i] = f2Mf1[2][i] ;
380 Lz[0][3] = 0 ; Lz[0][4] = 0 ; Lz[0][5] = 0 ;
385 if (translation ==
cMcd) {
389 Lx[0][0] = -1 ; Lx[0][1] = 0 ; Lx[0][2] = 0 ;
390 Lx[0][3] = 0 ; Lx[0][4] = -
s[2] ; Lx[0][5] =
s[1] ;
397 Ly[0][0] = 0 ; Ly[0][1] = -1 ; Ly[0][2] = 0 ;
398 Ly[0][3] =
s[2] ; Ly[0][4] = 0 ; Ly[0][5] = -
s[0] ;
405 Lz[0][0] = 0 ; Lz[0][1] = 0 ; Lz[0][2] = -1 ;
406 Lz[0][3] = -
s[1] ; Lz[0][4] =
s[0] ; Lz[0][5] = 0 ;
412 if (translation ==
cMo) {
416 Lx[0][0] = -1 ; Lx[0][1] = 0 ; Lx[0][2] = 0 ;
417 Lx[0][3] = 0 ; Lx[0][4] = -
s[2] ; Lx[0][5] =
s[1] ;
424 Ly[0][0] = 0 ; Ly[0][1] = -1 ; Ly[0][2] = 0 ;
425 Ly[0][3] =
s[2] ; Ly[0][4] = 0 ; Ly[0][5] = -
s[0] ;
432 Lz[0][0] = 0 ; Lz[0][1] = 0 ; Lz[0][2] = -1 ;
433 Lz[0][3] = -
s[1] ; Lz[0][4] =
s[0] ; Lz[0][5] = 0 ;
505 const unsigned int select)
509 if(translation ==
cdMc || translation ==
cMcd)
515 "s* should be zero !")) ;
523 ex[0] =
s[0]-s_star[0] ;
530 ey[0] =
s[1]-s_star[1] ;
537 ez[0] =
s[2]-s_star[2] ;
569 std::cout <<
"Translation 3D: ";
571 std::cout <<
s[0] <<
" ";
574 std::cout <<
s[1] <<
" ";
577 std::cout <<
s[2] <<
" ";
579 std::cout << std::endl;
597 if (translation ==
cdMc)
599 if (translation ==
cMo)
601 if (translation ==
cMcd)
618 static int firsttime =0 ;
639 static int firsttime =0 ;
Implementation of a matrix and operations on matrices.
Class that defines the translation visual feature .
bool * flags
Ensure that all the parameters needed to compute the iteraction matrix are set.
void stack(const double &d)
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
static unsigned int selectTx()
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class to define colors available for display functionnalities.
void stack(const vpMatrix &A)
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
void set_Ty(const double t_y)
void set_Tx(const double t_x)
static unsigned int selectTy()
vpFeatureTranslationRepresentationType getFeatureTranslationType() const
vpFeatureTranslationRepresentationType
vpFeatureTranslation * duplicate() const
Feature duplication.
class that defines what is a visual feature
void setFeatureTranslationType(const vpFeatureTranslationRepresentationType r)
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 const unsigned int FEATURE_LINE[32]
static unsigned int selectTz()
vpBasicFeatureDeallocatorType deallocate
vpColVector error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
void set_Tz(const double t_z)
Implementation of column vector and the associated operations.
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)