45 #include <visp3/core/vpDebug.h> 46 #include <visp3/core/vpMatrix.h> 47 #include <visp3/core/vpHomogeneousMatrix.h> 48 #include <visp3/core/vpQuaternionVector.h> 49 #include <visp3/core/vpPoint.h> 50 #include <visp3/core/vpException.h> 110 buildFrom(p[0], p[1], p[2], p[3], p[4], p[5]) ;
329 if (v.size() != 12 && v.size() != 16) {
333 for (
unsigned int i=0; i < 12; i++)
334 this->
data[i] = (
double)v[i];
379 if (v.size() != 12 && v.size() != 16) {
383 for (
unsigned int i=0; i < 12; i++)
384 this->
data[i] = v[i];
395 for (
int i=0; i<4; i++) {
396 for (
int j=0; j<4; j++) {
464 (*this) = (*this) * M;
478 "Cannot multiply a (4x4) homogeneous matrix by a (%dx1) column vector",
485 for (
unsigned int j=0;j<4;j++) {
486 for (
unsigned int i=0;i<4;i++) {
514 v1[0] = (*this)[0][0]*v[0] + (*this)[0][1]*v[1]+ (*this)[0][2]*v[2]+ (*this)[0][3]*v[3] ;
515 v1[1] = (*this)[1][0]*v[0] + (*this)[1][1]*v[1]+ (*this)[1][2]*v[2]+ (*this)[1][3]*v[3] ;
516 v1[2] = (*this)[2][0]*v[0] + (*this)[2][1]*v[1]+ (*this)[2][2]*v[2]+ (*this)[2][3]*v[3] ;
517 v1[3] = (*this)[3][0]*v[0] + (*this)[3][1]*v[1]+ (*this)[3][2]*v[2]+ (*this)[3][3]*v[3] ;
546 t_out[0] = (*this)[0][0]*t[0] + (*this)[0][1]*t[1]+ (*this)[0][2]*t[2]+ (*this)[0][3];
547 t_out[1] = (*this)[1][0]*t[0] + (*this)[1][1]*t[1]+ (*this)[1][2]*t[2]+ (*this)[1][3];
548 t_out[2] = (*this)[2][0]*t[0] + (*this)[2][1]*t[1]+ (*this)[2][2]*t[2]+ (*this)[2][3];
575 for (
unsigned int i=0 ; i < 3 ; i++)
576 for (
unsigned int j=0 ; j < 3; j++)
577 R[i][j] = (*
this)[i][j] ;
586 t[0] = (*this)[0][3] ;
587 t[1] = (*this)[1][3] ;
588 t[2] = (*this)[2][3] ;
618 for (
unsigned int i=0 ; i < 3 ; i++)
619 for (
unsigned int j=0 ; j < 3; j++)
620 (*
this)[i][j] = R[i][j] ;
642 (*this)[0][3] = t[0] ;
643 (*this)[1][3] = t[1] ;
644 (*this)[2][3] = t[2] ;
699 (*this)[0][1] = (*this)[0][2] = (*this)[0][3] = 0 ;
700 (*this)[1][0] = (*this)[1][2] = (*this)[1][3] = 0 ;
701 (*this)[2][0] = (*this)[2][1] = (*this)[2][3] = 0 ;
702 (*this)[3][0] = (*this)[3][1] = (*this)[3][2] = 0 ;
756 "Cannot save homogeneous matrix: ostream not open")) ;
783 for (
unsigned int i=0 ; i < 4 ; i++) {
784 for (
unsigned int j=0 ; j < 4 ; j++) {
791 "Cannot laad homogeneous matrix: ifstream not open")) ;
810 for(
unsigned int i=0; i < 12; i++)
811 M[i] = (
float)(this->
data[i]);
821 for(
unsigned int i=0; i < 12; i++)
822 M[i] = this->
data[i];
889 "Unable to extract a column vector from the homogeneous matrix"));
890 unsigned int nb_rows =
getRows();
892 for (
unsigned int i=0 ; i < nb_rows ; i++)
893 c[i] = (*
this)[i][j];
897 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) 911 #endif //#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) void set_oZ(const double oZ)
Set the point Z coordinate in the object frame.
Implementation of an homogeneous matrix and operations on such kind of matrices.
vp_deprecated void setIdentity()
void print() const
Print the matrix as a pose vector .
error that can be emited by ViSP classes.
unsigned int getRows() const
Return the number of rows of the 2D array.
vpHomogeneousMatrix inverse() const
double * data
Address of the first element of the data array.
vpQuaternionVector buildFrom(const double qx, const double qy, const double qz, const double qw)
vpColVector getCol(const unsigned int j) const
Implementation of a generic 2D array used as vase class of matrices and vectors.
void extract(vpRotationMatrix &R) const
void set_X(const double X)
Set the point X coordinate in the camera frame.
vpThetaUVector getThetaUVector() const
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
vpRotationMatrix t() const
void load(std::ifstream &f)
double get_W() const
Get the point W coordinate in the camera frame.
Class that defines what is a point.
Implementation of a rotation matrix and operations on such kind of matrices.
unsigned int getCols() const
Return the number of columns of the 2D array.
vpHomogeneousMatrix & operator=(const vpHomogeneousMatrix &M)
void insert(const vpRotationMatrix &R)
unsigned int rowNum
Number of rows in the array.
void set_oW(const double oW)
Set the point W coordinate in the object frame.
void set_Z(const double Z)
Set the point Z coordinate in the camera frame.
vpHomogeneousMatrix operator*(const vpHomogeneousMatrix &M) const
void set_W(const double W)
Set the point W coordinate in the camera frame.
bool isAnHomogeneousMatrix() const
void set_oX(const double oX)
Set the point X coordinate in the object frame.
void set_Y(const double Y)
Set the point Y coordinate in the camera frame.
Implementation of a rotation vector as quaternion angle minimal representation.
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
vpTranslationVector getTranslationVector() const
double get_X() const
Get the point X coordinate in the camera frame.
Implementation of column vector and the associated operations.
void set_oY(const double oY)
Set the point Y coordinate in the object frame.
Implementation of a pose vector and operations on poses.
void save(std::ofstream &f) const
vpHomogeneousMatrix & operator*=(const vpHomogeneousMatrix &M)
void convert(std::vector< float > &M)
double get_Z() const
Get the point Z coordinate in the camera frame.
double get_Y() const
Get the point Y coordinate in the camera frame.
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.
bool isARotationMatrix() const
double ** rowPtrs
Address of the first element of each rows.
vpRotationMatrix getRotationMatrix() const