31 void Pose::Output()
const {
32 cout<<quaternion[0]<<
","<<quaternion[1]<<
","<<quaternion[2]<<
","<<quaternion[3]<<
"|";
33 cout<<translation[0]<<
","<<translation[1]<<
","<<translation[2]<<endl;
78 for(
int i = 0; i < 3; ++i)
79 for(
int j = 0; j < 3; ++j)
80 tmp[i*3+j] = cvmGet(mat, i, j);
93 if (mat->width == 3) {
95 }
else if (mat->width == 4) {
106 if (mirror)
Mirror(
false,
true,
true);
107 CvMat gl_mat = cvMat(4, 4, CV_64F, gl);
109 cvTranspose(&gl_mat, &gl_mat);
110 if (mirror)
Mirror(
false,
true,
true);
116 memcpy(gll, gl,
sizeof(
double)*16);
117 CvMat gl_mat = cvMat(4, 4, CV_64F, gll);
118 cvTranspose(&gl_mat, &gl_mat);
120 if (mirror)
Mirror(
false,
true,
true);
126 CvMat tmp_mat = cvMat(4, 4, CV_64F, tmp);
128 cvTranspose(&tmp_mat, &tmp_mat);
135 CvMat tmp_mat = cvMat(4, 4, CV_64F, tmp);
137 cvInvert(&tmp_mat, &tmp_mat);
144 CvMat tmp_mat = cvMat(4, 4, CV_64F, tmp);
172 if (tra->rows == 4) cvmSet(tra, 3, 0, 1);
void SetMatrix(const CvMat *mat)
void GetMatrixGL(double gl[16], bool mirror=true)
Get the transformation matrix representation of the Pose using OpenGL's transposed format...
static void QuatToMat9(const double *quat, double *mat)
Converts a rotation described by a quaternion into 3x3 rotation matrix.
void GetTranslation(CvMat *tra) const
RotationType
Rotation can be represented in four ways: quaternion (QUAT), matrix (MAT), euler angles (EUL) and exp...
Pose & operator=(const Pose &p)
static void MirrorMat(CvMat *mat, bool x, bool y, bool z)
Simple function to mirror a rotation matrix in different directions.
static void Mat9ToQuat(const double *mat, double *quat)
Converts a 3x3 rotation martix into quaternion form.
void SetMatrixGL(double gl[16], bool mirror=true)
Set the Pose using OpenGL's transposed format. Note, that by default this also mirrors both the y- an...
Pose representation derived from the Rotation class
void Mirror(bool x, bool y, bool z)
void GetMatrix(CvMat *mat) const
This file implements a pose.
void SetTranslation(const CvMat *tra)
Rotation structure and transformations between different parameterizations.
static void QuatToMat16(const double *quat, double *mat)
Converts a rotation described by a quaternion into 4x4 OpenGL-like transformation matrix...