45 #include <visp3/core/vpDebug.h> 46 #include <visp3/core/vpException.h> 47 #include <visp3/core/vpHomogeneousMatrix.h> 48 #include <visp3/core/vpMatrix.h> 49 #include <visp3/core/vpPoint.h> 50 #include <visp3/core/vpQuaternionVector.h> 102 buildFrom(p[0], p[1], p[2], p[3], p[4], p[5]);
202 const double tuy,
const double tuz)
257 const double tuy,
const double tuz)
308 if (v.size() != 12 && v.size() != 16) {
312 for (
unsigned int i = 0; i < 12; i++)
313 this->
data[i] = (
double)v[i];
358 if (v.size() != 12 && v.size() != 16) {
362 for (
unsigned int i = 0; i < 12; i++)
363 this->
data[i] = v[i];
373 for (
int i = 0; i < 4; i++) {
374 for (
int j = 0; j < 4; j++) {
440 (*this) = (*this) * M;
455 "Cannot multiply a (4x4) homogeneous matrix by a " 456 "(%dx1) column vector",
463 for (
unsigned int j = 0; j < 4; j++) {
464 for (
unsigned int i = 0; i < 4; i++) {
494 v1[0] = (*this)[0][0] * v[0] + (*this)[0][1] * v[1] + (*this)[0][2] * v[2] + (*this)[0][3] * v[3];
495 v1[1] = (*this)[1][0] * v[0] + (*this)[1][1] * v[1] + (*this)[1][2] * v[2] + (*this)[1][3] * v[3];
496 v1[2] = (*this)[2][0] * v[0] + (*this)[2][1] * v[1] + (*this)[2][2] * v[2] + (*this)[2][3] * v[3];
497 v1[3] = (*this)[3][0] * v[0] + (*this)[3][1] * v[1] + (*this)[3][2] * v[2] + (*this)[3][3] * v[3];
528 t_out[0] = (*this)[0][0] * t[0] + (*this)[0][1] * t[1] + (*this)[0][2] * t[2] + (*this)[0][3];
529 t_out[1] = (*this)[1][0] * t[0] + (*this)[1][1] * t[1] + (*this)[1][2] * t[2] + (*this)[1][3];
530 t_out[2] = (*this)[2][0] * t[0] + (*this)[2][1] * t[1] + (*this)[2][2] * t[2] + (*this)[2][3];
555 for (
unsigned int i = 0; i < 3; i++)
556 for (
unsigned int j = 0; j < 3; j++)
557 R[i][j] = (*
this)[i][j];
565 t[0] = (*this)[0][3];
566 t[1] = (*this)[1][3];
567 t[2] = (*this)[2][3];
594 for (
unsigned int i = 0; i < 3; i++)
595 for (
unsigned int j = 0; j < 3; j++)
596 (*
this)[i][j] = R[i][j];
616 (*this)[0][3] = t[0];
617 (*this)[1][3] = t[1];
618 (*this)[2][3] = t[2];
671 (*this)[0][1] = (*this)[0][2] = (*this)[0][3] = 0;
672 (*this)[1][0] = (*this)[1][2] = (*this)[1][3] = 0;
673 (*this)[2][0] = (*this)[2][1] = (*this)[2][3] = 0;
674 (*this)[3][0] = (*this)[3][1] = (*this)[3][2] = 0;
745 for (
unsigned int i = 0; i < 4; i++) {
746 for (
unsigned int j = 0; j < 4; j++) {
769 for (
unsigned int i = 0; i < 12; i++)
770 M[i] = (
float)(this->
data[i]);
780 for (
unsigned int i = 0; i < 12; i++)
781 M[i] = this->
data[i];
847 unsigned int nb_rows =
getRows();
849 for (
unsigned int i = 0; i < nb_rows; i++)
850 c[i] = (*
this)[i][j];
854 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) 864 #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
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
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