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++) {
454 "Cannot multiply a (4x4) homogeneous matrix by a (%dx1) column vector",
461 for (
unsigned int j=0;j<4;j++) {
462 for (
unsigned int i=0;i<4;i++) {
490 v1[0] = (*this)[0][0]*v[0] + (*this)[0][1]*v[1]+ (*this)[0][2]*v[2]+ (*this)[0][3]*v[3] ;
491 v1[1] = (*this)[1][0]*v[0] + (*this)[1][1]*v[1]+ (*this)[1][2]*v[2]+ (*this)[1][3]*v[3] ;
492 v1[2] = (*this)[2][0]*v[0] + (*this)[2][1]*v[1]+ (*this)[2][2]*v[2]+ (*this)[2][3]*v[3] ;
493 v1[3] = (*this)[3][0]*v[0] + (*this)[3][1]*v[1]+ (*this)[3][2]*v[2]+ (*this)[3][3]*v[3] ;
533 for (
unsigned int i=0 ; i < 3 ; i++)
534 for (
unsigned int j=0 ; j < 3; j++)
535 R[i][j] = (*
this)[i][j] ;
544 t[0] = (*this)[0][3] ;
545 t[1] = (*this)[1][3] ;
546 t[2] = (*this)[2][3] ;
576 for (
unsigned int i=0 ; i < 3 ; i++)
577 for (
unsigned int j=0 ; j < 3; j++)
578 (*
this)[i][j] = R[i][j] ;
600 (*this)[0][3] = t[0] ;
601 (*this)[1][3] = t[1] ;
602 (*this)[2][3] = t[2] ;
657 (*this)[0][1] = (*this)[0][2] = (*this)[0][3] = 0 ;
658 (*this)[1][0] = (*this)[1][2] = (*this)[1][3] = 0 ;
659 (*this)[2][0] = (*this)[2][1] = (*this)[2][3] = 0 ;
660 (*this)[3][0] = (*this)[3][1] = (*this)[3][2] = 0 ;
714 "Cannot save homogeneous matrix: ostream not open")) ;
741 for (
unsigned int i=0 ; i < 4 ; i++) {
742 for (
unsigned int j=0 ; j < 4 ; j++) {
749 "Cannot laad homogeneous matrix: ifstream not open")) ;
777 for(
unsigned int i=0; i < 12; i++)
778 M[i] = (
float)(this->
data[i]);
788 for(
unsigned int i=0; i < 12; i++)
789 M[i] = this->
data[i];
856 "Unable to extract a column vector from the homogeneous matrix"));
857 unsigned int nb_rows =
getRows();
859 for (
unsigned int i=0 ; i < nb_rows ; i++)
860 c[i] = (*
this)[i][j];
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()
error that can be emited by ViSP classes.
vpRotationMatrix t() 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)
Implementation of a generic 2D array used as vase class of matrices and vectors.
unsigned int getCols() const
Return the number of columns of the 2D array.
void set_X(const double X)
Set the point X coordinate in the camera frame.
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
double get_W() const
Get the point W coordinate in the camera frame.
void load(std::ifstream &f)
Class that defines what is a point.
bool isARotationMatrix() const
Implementation of a rotation matrix and operations on such kind of matrices.
vpHomogeneousMatrix & operator=(const vpHomogeneousMatrix &M)
vpTranslationVector getTranslationVector()
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.
vpRotationMatrix getRotationMatrix()
void set_W(const double W)
Set the point W coordinate in the camera frame.
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.
void extract(vpRotationMatrix &R) const
Implementation of a rotation vector as quaternion angle minimal representation.
unsigned int getRows() const
Return the number of rows of the 2D array.
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
double get_Y() const
Get the point Y coordinate in the camera frame.
double get_Z() const
Get the point Z coordinate in the camera frame.
bool isAnHomogeneousMatrix() const
void save(std::ofstream &f) const
vpHomogeneousMatrix operator*(const vpHomogeneousMatrix &M) const
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.
vpHomogeneousMatrix inverse() const
vpThetaUVector getThetaUVector()
vpColVector getCol(const unsigned int j) const
void convert(std::vector< float > &M)
void print() const
Print the matrix as a pose vector .
double get_X() const
Get the point X coordinate in the camera frame.
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.
double ** rowPtrs
Address of the first element of each rows.