Visual Servoing Platform  version 3.6.1 under development (2024-04-19)
vpHomogeneousMatrix.cpp
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See https://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description:
32  * Homogeneous matrix.
33  *
34 *****************************************************************************/
35 
42 #include <visp3/core/vpDebug.h>
43 #include <visp3/core/vpException.h>
44 #include <visp3/core/vpHomogeneousMatrix.h>
45 #include <visp3/core/vpMatrix.h>
46 #include <visp3/core/vpPoint.h>
47 #include <visp3/core/vpQuaternionVector.h>
48 
54  : vpArray2D<double>(4, 4)
55 {
56  buildFrom(t, q);
57  (*this)[3][3] = 1.;
58 }
59 
63 vpHomogeneousMatrix::vpHomogeneousMatrix() : vpArray2D<double>(4, 4), m_index(0) { eye(); }
64 
70 {
71  *this = M;
72 }
73 
79  : vpArray2D<double>(4, 4), m_index(0)
80 {
81  buildFrom(t, tu);
82  (*this)[3][3] = 1.;
83 }
84 
90  : vpArray2D<double>(4, 4), m_index(0)
91 {
92  insert(R);
93  insert(t);
94  (*this)[3][3] = 1.;
95 }
96 
101 {
102  buildFrom(p[0], p[1], p[2], p[3], p[4], p[5]);
103  (*this)[3][3] = 1.;
104 }
105 
145 vpHomogeneousMatrix::vpHomogeneousMatrix(const std::vector<float> &v) : vpArray2D<double>(4, 4), m_index(0)
146 {
147  buildFrom(v);
148  (*this)[3][3] = 1.;
149 }
150 
151 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
188 vpHomogeneousMatrix::vpHomogeneousMatrix(const std::initializer_list<double> &list)
189  : vpArray2D<double>(4, 4), m_index(0)
190 {
191  if (list.size() == 12) {
192  std::copy(list.begin(), list.end(), data);
193  data[12] = 0.;
194  data[13] = 0.;
195  data[14] = 0.;
196  data[15] = 1.;
197  }
198  else if (list.size() == 16) {
199  std::copy(list.begin(), list.end(), data);
200  for (size_t i = 12; i < 15; ++i) {
201  if (std::fabs(data[i]) > std::numeric_limits<double>::epsilon()) {
203  "Cannot initialize homogeneous matrix. "
204  "List element %d (%f) should be 0.",
205  i, data[i]));
206  }
207  }
208  if (std::fabs(data[15] - 1.) > std::numeric_limits<double>::epsilon()) {
210  "Cannot initialize homogeneous matrix. "
211  "List element 15 (%f) should be 1.",
212  data[15]));
213  }
214  }
215  else {
217  "Cannot initialize homogeneous matrix from a list (%d elements) that has not 12 or 16 elements",
218  list.size()));
219  }
220 
221  if (!isAnHomogeneousMatrix()) {
222  if (isAnHomogeneousMatrix(1e-3)) {
223  // re-orthogonalize rotation matrix since the input is close to a valid rotation matrix
224  vpRotationMatrix R(*this);
225  R.orthogonalize();
226 
227  data[0] = R[0][0];
228  data[1] = R[0][1];
229  data[2] = R[0][2];
230  data[4] = R[1][0];
231  data[5] = R[1][1];
232  data[6] = R[1][2];
233  data[8] = R[2][0];
234  data[9] = R[2][1];
235  data[10] = R[2][2];
236  }
237  else {
238  throw(vpException(
240  "Homogeneous matrix initialization fails since its elements are not valid (rotation part or last row)"));
241  }
242  }
243 }
244 #endif
245 
285 vpHomogeneousMatrix::vpHomogeneousMatrix(const std::vector<double> &v) : vpArray2D<double>(4, 4), m_index(0)
286 {
287  buildFrom(v);
288  (*this)[3][3] = 1.;
289 }
290 
296 vpHomogeneousMatrix::vpHomogeneousMatrix(double tx, double ty, double tz, double tux, double tuy, double tuz)
297  : vpArray2D<double>(4, 4), m_index(0)
298 {
299  buildFrom(tx, ty, tz, tux, tuy, tuz);
300  (*this)[3][3] = 1.;
301 }
302 
308 {
309  insert(tu);
310  insert(t);
311 }
312 
318 {
319  insert(R);
320  insert(t);
321 }
322 
327 {
328  vpTranslationVector tv(p[0], p[1], p[2]);
329  vpThetaUVector tu(p[3], p[4], p[5]);
330 
331  insert(tu);
332  insert(tv);
333 }
334 
340 {
341  insert(t);
342  insert(q);
343 }
344 
350 void vpHomogeneousMatrix::buildFrom(double tx, double ty, double tz, double tux, double tuy, double tuz)
351 {
352  vpRotationMatrix R(tux, tuy, tuz);
353  vpTranslationVector t(tx, ty, tz);
354 
355  insert(R);
356  insert(t);
357 }
358 
399 void vpHomogeneousMatrix::buildFrom(const std::vector<float> &v)
400 {
401  if ((v.size() != 12) && (v.size() != 16)) {
402  throw(vpException(vpException::dimensionError, "Cannot convert std::vector<float> to vpHomogeneousMatrix"));
403  }
404 
405  for (unsigned int i = 0; i < 12; ++i) {
406  this->data[i] = static_cast<double>(v[i]);
407  }
408 }
409 
450 void vpHomogeneousMatrix::buildFrom(const std::vector<double> &v)
451 {
452  if ((v.size() != 12) && (v.size() != 16)) {
453  throw(vpException(vpException::dimensionError, "Cannot convert std::vector<double> to vpHomogeneousMatrix"));
454  }
455 
456  for (unsigned int i = 0; i < 12; ++i) {
457  this->data[i] = v[i];
458  }
459 }
460 
467 {
468  for (int i = 0; i < 4; ++i) {
469  for (int j = 0; j < 4; ++j) {
470  rowPtrs[i][j] = M.rowPtrs[i][j];
471  }
472  }
473  return *this;
474 }
475 
494 {
496 
497  vpRotationMatrix R1, R2, R;
498  vpTranslationVector T1, T2, T;
499 
500  extract(T1);
501  M.extract(T2);
502 
503  extract(R1);
504  M.extract(R2);
505 
506  R = R1 * R2;
507 
508  T = (R1 * T2) + T1;
509 
510  p.insert(T);
511  p.insert(R);
512 
513  return p;
514 }
515 
534 {
535  (*this) = (*this) * M;
536  return (*this);
537 }
538 
547 {
548  if (v.getRows() != 4) {
550  "Cannot multiply a (4x4) homogeneous matrix by a "
551  "(%dx1) column vector",
552  v.getRows()));
553  }
554  vpColVector p(rowNum);
555 
556  p = 0.0;
557 
558  for (unsigned int j = 0; j < 4; ++j) {
559  for (unsigned int i = 0; i < 4; ++i) {
560  p[i] += rowPtrs[i][j] * v[j];
561  }
562  }
563 
564  return p;
565 }
566 
579 {
580  vpPoint aP;
581 
582  vpColVector v(4), v1(4);
583 
584  v[0] = bP.get_X();
585  v[1] = bP.get_Y();
586  v[2] = bP.get_Z();
587  v[3] = bP.get_W();
588 
589  v1[0] = ((*this)[0][0] * v[0]) + ((*this)[0][1] * v[1]) + ((*this)[0][2] * v[2]) + ((*this)[0][3] * v[3]);
590  v1[1] = ((*this)[1][0] * v[0]) + ((*this)[1][1] * v[1]) + ((*this)[1][2] * v[2]) + ((*this)[1][3] * v[3]);
591  v1[2] = ((*this)[2][0] * v[0]) + ((*this)[2][1] * v[1]) + ((*this)[2][2] * v[2]) + ((*this)[2][3] * v[3]);
592  v1[3] = ((*this)[3][0] * v[0]) + ((*this)[3][1] * v[1]) + ((*this)[3][2] * v[2]) + ((*this)[3][3] * v[3]);
593 
594  v1 /= v1[3];
595 
596  // --comment: v1 equals M multiplied by v
597  aP.set_X(v1[0]);
598  aP.set_Y(v1[1]);
599  aP.set_Z(v1[2]);
600  aP.set_W(v1[3]);
601 
602  aP.set_oX(v1[0]);
603  aP.set_oY(v1[1]);
604  aP.set_oZ(v1[2]);
605  aP.set_oW(v1[3]);
606 
607  return aP;
608 }
609 
621 {
622  vpTranslationVector t_out;
623  t_out[0] = (((*this)[0][0] * t[0]) + ((*this)[0][1] * t[1]) + ((*this)[0][2] * t[2])) + (*this)[0][3];
624  t_out[1] = (((*this)[1][0] * t[0]) + ((*this)[1][1] * t[1]) + ((*this)[1][2] * t[2])) + (*this)[1][3];
625  t_out[2] = (((*this)[2][0] * t[0]) + ((*this)[2][1] * t[1]) + ((*this)[2][2] * t[2])) + (*this)[2][3];
626 
627  return t_out;
628 }
629 
645 {
646  return (vpHomogeneousMatrix((*this).getTranslationVector(), (*this).getRotationMatrix() * R));
647 }
648 
692 {
693  m_index = 0;
694  data[m_index] = val;
695  return *this;
696 }
697 
741 {
742  m_index++;
743  if (m_index >= size()) {
745  "Cannot set homogenous matrix out of bounds. It has only %d elements while you try to initialize "
746  "with %d elements",
747  size(), m_index + 1));
748  }
749  data[m_index] = val;
750  return *this;
751 }
752 
753 /*********************************************************************/
754 
761 bool vpHomogeneousMatrix::isAnHomogeneousMatrix(double threshold) const
762 {
764  extract(R);
765 
766  const double epsilon = std::numeric_limits<double>::epsilon();
767  return R.isARotationMatrix(threshold) && vpMath::nul((*this)[3][0], epsilon) && vpMath::nul((*this)[3][1], epsilon) &&
768  vpMath::nul((*this)[3][2], epsilon) && vpMath::equal((*this)[3][3], 1.0, epsilon);
769 }
770 
776 {
777  unsigned int l_size = size();
778  for (unsigned int i = 0; i < l_size; ++i) {
779  if (vpMath::isNaN(data[i])) {
780  return false;
781  }
782  }
783  return true;
784 }
785 
791 {
792  for (unsigned int i = 0; i < 3; ++i) {
793  for (unsigned int j = 0; j < 3; ++j) {
794  R[i][j] = (*this)[i][j];
795  }
796  }
797 }
798 
803 {
804  t[0] = (*this)[0][3];
805  t[1] = (*this)[1][3];
806  t[2] = (*this)[2][3];
807 }
812 {
814  (*this).extract(R);
815  tu.buildFrom(R);
816 }
817 
822 {
824  (*this).extract(R);
825  q.buildFrom(R);
826 }
827 
832 {
833  for (unsigned int i = 0; i < 3; ++i) {
834  for (unsigned int j = 0; j < 3; ++j) {
835  (*this)[i][j] = R[i][j];
836  }
837  }
838 }
839 
847 {
848  vpRotationMatrix R(tu);
849  insert(R);
850 }
851 
856 {
857  (*this)[0][3] = t[0];
858  (*this)[1][3] = t[1];
859  (*this)[2][3] = t[2];
860 }
861 
869 
885 {
887 
889  extract(R);
891  extract(T);
892 
894  RtT = -(R.t() * T);
895 
896  Mi.insert(R.t());
897  Mi.insert(RtT);
898 
899  return Mi;
900 }
901 
906 {
907  (*this)[0][0] = 1;
908  (*this)[1][1] = 1;
909  (*this)[2][2] = 1;
910  (*this)[3][3] = 1;
911 
912  (*this)[0][1] = 0;
913  (*this)[0][2] = 0;
914  (*this)[0][3] = 0;
915  (*this)[1][0] = 0;
916  (*this)[1][2] = 0;
917  (*this)[1][3] = 0;
918  (*this)[2][0] = 0;
919  (*this)[2][1] = 0;
920  (*this)[2][3] = 0;
921  (*this)[3][0] = 0;
922  (*this)[3][1] = 0;
923  (*this)[3][2] = 0;
924 }
925 
941 
942 void vpHomogeneousMatrix::save(std::ofstream &f) const
943 {
944  if (!f.fail()) {
945  f << *this;
946  }
947  else {
948  throw(vpException(vpException::ioError, "Cannot save homogeneous matrix: ostream not open"));
949  }
950 }
951 
952 void vpHomogeneousMatrix::save(const std::string &filename) const
953 {
954  std::ofstream f;
955  f.open(filename.c_str());
956  save(f);
957  f.close();
958 }
959 
960 void vpHomogeneousMatrix::load(std::ifstream &f)
961 {
962  if (!f.fail()) {
963  for (unsigned int i = 0; i < 4; ++i) {
964  for (unsigned int j = 0; j < 4; ++j) {
965  f >> (*this)[i][j];
966  }
967  }
968  }
969  else {
970  throw(vpException(vpException::ioError, "Cannot load homogeneous matrix: ifstream not open"));
971  }
972 }
973 
974 void vpHomogeneousMatrix::load(const std::string &filename)
975 {
976  std::ifstream f;
977  f.open(filename.c_str());
978  load(f);
979  f.close();
980 }
981 
986 {
987  vpRotationMatrix R(*this);
988  R.orthogonalize();
989 
990  data[0] = R[0][0];
991  data[1] = R[0][1];
992  data[2] = R[0][2];
993  data[4] = R[1][0];
994  data[5] = R[1][1];
995  data[6] = R[1][2];
996  data[8] = R[2][0];
997  data[9] = R[2][1];
998  data[10] = R[2][2];
999 }
1000 
1003 {
1004  vpPoseVector r(*this);
1005  std::cout << r.t();
1006 }
1007 
1012 void vpHomogeneousMatrix::convert(std::vector<float> &M)
1013 {
1014  M.resize(12);
1015  for (unsigned int i = 0; i < 12; ++i) {
1016  M[i] = static_cast<float>(this->data[i]);
1017  }
1018 }
1019 
1024 void vpHomogeneousMatrix::convert(std::vector<double> &M)
1025 {
1026  M.resize(12);
1027  for (unsigned int i = 0; i < 12; ++i) {
1028  M[i] = this->data[i];
1029  }
1030 }
1031 
1036 {
1038  this->extract(tr);
1039  return tr;
1040 }
1041 
1046 {
1047  vpRotationMatrix R;
1048  this->extract(R);
1049  return R;
1050 }
1051 
1057 {
1058  vpThetaUVector tu;
1059  this->extract(tu);
1060  return tu;
1061 }
1062 
1092 {
1093  if (j >= getCols()) {
1094  throw(vpException(vpException::dimensionError, "Unable to extract a column vector from the homogeneous matrix"));
1095  }
1096  unsigned int nb_rows = getRows();
1097  vpColVector c(nb_rows);
1098  for (unsigned int i = 0; i < nb_rows; ++i) {
1099  c[i] = (*this)[i][j];
1100  }
1101  return c;
1102 }
1103 
1110 vpHomogeneousMatrix vpHomogeneousMatrix::compute3d3dTransformation(const std::vector<vpPoint> &p, const std::vector<vpPoint> &q)
1111 {
1112  const double N = static_cast<double>(p.size());
1113 
1114  vpColVector p_bar(3, 0.0);
1115  vpColVector q_bar(3, 0.0);
1116  size_t p_size = p.size();
1117  for (size_t i = 0; i < p_size; ++i) {
1118  for (unsigned int j = 0; j < 3; ++j) {
1119  p_bar[j] += p.at(i).oP[j];
1120  q_bar[j] += q.at(i).oP[j];
1121  }
1122  }
1123 
1124  for (unsigned int j = 0; j < 3; ++j) {
1125  p_bar[j] /= N;
1126  q_bar[j] /= N;
1127  }
1128 
1129  vpMatrix pc(static_cast<unsigned int>(p.size()), 3);
1130  vpMatrix qc(static_cast<unsigned int>(q.size()), 3);
1131 
1132  for (unsigned int i = 0; i < static_cast<unsigned int>(p_size); ++i) {
1133  for (unsigned int j = 0; j < 3; ++j) {
1134  pc[i][j] = p.at(i).oP[j] - p_bar[j];
1135  qc[i][j] = q.at(i).oP[j] - q_bar[j];
1136  }
1137  }
1138 
1139  const vpMatrix pct_qc = pc.t() * qc;
1140  vpMatrix U = pct_qc, V;
1141  vpColVector W;
1142  U.svd(W, V);
1143 
1144  vpMatrix Vt = V.t();
1145  vpMatrix R = U * Vt;
1146  if (R.det() < 0) {
1147  Vt[2][0] *= -1;
1148  Vt[2][1] *= -1;
1149  Vt[2][2] *= -1;
1150 
1151  R = U * Vt;
1152  }
1153 
1154  const vpColVector t = p_bar - (R * q_bar);
1155 
1157 }
1158 
1168 vpHomogeneousMatrix vpHomogeneousMatrix::mean(const std::vector<vpHomogeneousMatrix> &vec_M)
1169 {
1170  vpMatrix meanR(3, 3);
1171  vpColVector meanT(3);
1172  vpRotationMatrix R;
1173  size_t vec_m_size = vec_M.size();
1174  for (size_t i = 0; i < vec_m_size; ++i) {
1175  R = vec_M[i].getRotationMatrix();
1176  meanR += (vpMatrix)R;
1177  meanT += (vpColVector)vec_M[i].getTranslationVector();
1178  }
1179  meanR /= static_cast<double>(vec_M.size());
1180  meanT /= static_cast<double>(vec_M.size());
1181 
1182  // Euclidean mean of the rotation matrix following Moakher's method (SIAM 2002)
1183  vpMatrix M, U, V;
1184  vpColVector sv;
1185  meanR.pseudoInverse(M, sv, 1e-6, U, V);
1186  double det = sv[0] * sv[1] * sv[2];
1187  if (det > 0) {
1188  meanR = U * V.t();
1189  }
1190  else {
1191  vpMatrix D(3, 3);
1192  D = 0.0;
1193  D[0][0] = 1.0;
1194  D[1][1] = 1.0;
1195  D[2][2] = -1;
1196  meanR = U * D * V.t();
1197  }
1198 
1199  R = meanR;
1200 
1201  vpTranslationVector t(meanT);
1203  return mean;
1204 }
1205 
1206 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
1207 
1215 
1216 #endif //#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
1217 
1218 #ifdef VISP_HAVE_NLOHMANN_JSON
1219 const std::string vpHomogeneousMatrix::jsonTypeName = "vpHomogeneousMatrix";
1220 #include <visp3/core/vpJsonParsing.h>
1221 void vpHomogeneousMatrix::convert_to_json(nlohmann::json &j) const
1222 {
1223  const vpArray2D<double> *asArray = (vpArray2D<double>*) this;
1224  to_json(j, *asArray);
1226 }
1227 
1228 void vpHomogeneousMatrix::parse_json(const nlohmann::json &j)
1229 {
1230  vpArray2D<double> *asArray = (vpArray2D<double>*) this;
1231  if (j.is_object() && j.contains("type")) { // Specific conversions
1232  const bool converted = convertFromTypeAndBuildFrom<vpHomogeneousMatrix, vpPoseVector>(j, *this);
1233  if (!converted) {
1234  from_json(j, *asArray);
1235  }
1236  }
1237  else { // Generic 2D array conversion
1238  from_json(j, *asArray);
1239  }
1240 
1241  if ((getCols() != 4) && (getRows() != 4)) {
1242  throw vpException(vpException::badValue, "From JSON, tried to read something that is not a 4x4 matrix");
1243  }
1244  if (!isAnHomogeneousMatrix()) {
1245  throw vpException(vpException::badValue, "From JSON read a non homogeneous matrix into a vpHomogeneousMatrix");
1246  }
1247 }
1248 #endif
Implementation of a generic 2D array used as base class for matrices and vectors.
Definition: vpArray2D.h:126
unsigned int getCols() const
Definition: vpArray2D.h:327
double * data
Address of the first element of the data array.
Definition: vpArray2D.h:139
double ** rowPtrs
Address of the first element of each rows.
Definition: vpArray2D.h:133
unsigned int rowNum
Number of rows in the array.
Definition: vpArray2D.h:129
unsigned int size() const
Return the number of elements of the 2D array.
Definition: vpArray2D.h:339
vpArray2D< double > t() const
Compute the transpose of the array.
Definition: vpArray2D.h:1132
unsigned int getRows() const
Definition: vpArray2D.h:337
Implementation of column vector and the associated operations.
Definition: vpColVector.h:163
error that can be emitted by ViSP classes.
Definition: vpException.h:59
@ ioError
I/O error.
Definition: vpException.h:79
@ badValue
Used to indicate that a value is not in the allowed range.
Definition: vpException.h:85
@ dimensionError
Bad dimension.
Definition: vpException.h:83
@ fatalError
Fatal error.
Definition: vpException.h:84
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpThetaUVector getThetaUVector() const
void load(std::ifstream &f)
friend void from_json(const nlohmann::json &j, vpHomogeneousMatrix &T)
vp_deprecated void setIdentity()
static const std::string jsonTypeName
void print() const
Print the matrix as a pose vector .
vpRotationMatrix getRotationMatrix() const
bool isAnHomogeneousMatrix(double threshold=1e-6) const
static vpHomogeneousMatrix compute3d3dTransformation(const std::vector< vpPoint > &p, const std::vector< vpPoint > &q)
vpHomogeneousMatrix & operator*=(const vpHomogeneousMatrix &M)
vpHomogeneousMatrix inverse() const
static vpHomogeneousMatrix mean(const std::vector< vpHomogeneousMatrix > &vec_M)
vpTranslationVector getTranslationVector() const
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
void convert(std::vector< float > &M)
friend void to_json(nlohmann::json &j, const vpHomogeneousMatrix &cam)
void extract(vpRotationMatrix &R) const
vpColVector getCol(unsigned int j) const
vpHomogeneousMatrix & operator<<(double val)
void insert(const vpRotationMatrix &R)
vpHomogeneousMatrix operator*(const vpHomogeneousMatrix &M) const
void save(std::ofstream &f) const
vpHomogeneousMatrix & operator=(const vpHomogeneousMatrix &M)
vpHomogeneousMatrix & operator,(double val)
static bool isNaN(double value)
Definition: vpMath.cpp:93
static bool equal(double x, double y, double threshold=0.001)
Definition: vpMath.h:449
static bool nul(double x, double threshold=0.001)
Definition: vpMath.h:440
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:146
void svd(vpColVector &w, vpMatrix &V)
Definition: vpMatrix.cpp:2132
vpMatrix t() const
Definition: vpMatrix.cpp:465
vpMatrix pseudoInverse(double svThreshold=1e-6) const
Definition: vpMatrix.cpp:2343
double det(vpDetMethod method=LU_DECOMPOSITION) const
Definition: vpMatrix.cpp:6275
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Definition: vpPoint.h:77
void set_W(double cW)
Set the point cW coordinate in the camera frame.
Definition: vpPoint.cpp:492
void set_oW(double oW)
Set the point oW coordinate in the object frame.
Definition: vpPoint.cpp:501
double get_Y() const
Get the point cY coordinate in the camera frame.
Definition: vpPoint.cpp:447
void set_oY(double oY)
Set the point oY coordinate in the object frame.
Definition: vpPoint.cpp:497
void set_X(double cX)
Set the point cX coordinate in the camera frame.
Definition: vpPoint.cpp:486
double get_W() const
Get the point cW coordinate in the camera frame.
Definition: vpPoint.cpp:451
void set_Y(double cY)
Set the point cY coordinate in the camera frame.
Definition: vpPoint.cpp:488
double get_Z() const
Get the point cZ coordinate in the camera frame.
Definition: vpPoint.cpp:449
void set_oZ(double oZ)
Set the point oZ coordinate in the object frame.
Definition: vpPoint.cpp:499
void set_Z(double cZ)
Set the point cZ coordinate in the camera frame.
Definition: vpPoint.cpp:490
void set_oX(double oX)
Set the point oX coordinate in the object frame.
Definition: vpPoint.cpp:495
double get_X() const
Get the point cX coordinate in the camera frame.
Definition: vpPoint.cpp:445
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:189
vpRowVector t() const
Implementation of a rotation vector as quaternion angle minimal representation.
vpQuaternionVector buildFrom(const double qx, const double qy, const double qz, const double qw)
Implementation of a rotation matrix and operations on such kind of matrices.
bool isARotationMatrix(double threshold=1e-6) const
vpRotationMatrix t() const
Implementation of a rotation vector as axis-angle minimal representation.
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
Class that consider the case of a translation vector.