HHomMat3D.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /***********************************************************
  2. * File generated by the HALCON-Compiler hcomp version 20.11
  3. * Usage: Interface to C++
  4. *
  5. * Software by: MVTec Software GmbH, www.mvtec.com
  6. ***********************************************************/
  7. #ifndef HCPP_HHOMMAT3D
  8. #define HCPP_HHOMMAT3D
  9. namespace HalconCpp
  10. {
  11. // Represents a homogeneous 3D transformation matrix.
  12. class LIntExport HHomMat3D : public HDataBase
  13. {
  14. public:
  15. // Copy constructor
  16. HHomMat3D(const HHomMat3D& source) : HDataBase(source) {}
  17. // Constructor from HTuple
  18. explicit HHomMat3D(const HTuple& tuple) : HDataBase(tuple) {}
  19. // Deep copy of all data represented by this object instance
  20. HHomMat3D Clone() const;
  21. /*****************************************************************************
  22. * Operator-based class constructors
  23. *****************************************************************************/
  24. // hom_mat3d_identity: Generate the homogeneous transformation matrix of the identical 3D transformation.
  25. explicit HHomMat3D();
  26. /***************************************************************************
  27. * Operators *
  28. ***************************************************************************/
  29. // Deserialize a serialized homogeneous 3D transformation matrix.
  30. void DeserializeHomMat3d(const HSerializedItem& SerializedItemHandle);
  31. // Serialize a homogeneous 3D transformation matrix.
  32. HSerializedItem SerializeHomMat3d() const;
  33. // Project a homogeneous 3D point using a projective transformation matrix.
  34. HTuple ProjectiveTransHomPoint3d(const HTuple& Px, const HTuple& Py, const HTuple& Pz, const HTuple& Pw, HTuple* Qy, HTuple* Qz, HTuple* Qw) const;
  35. // Project a homogeneous 3D point using a projective transformation matrix.
  36. double ProjectiveTransHomPoint3d(double Px, double Py, double Pz, double Pw, double* Qy, double* Qz, double* Qw) const;
  37. // Project a 3D point using a projective transformation matrix.
  38. HTuple ProjectiveTransPoint3d(const HTuple& Px, const HTuple& Py, const HTuple& Pz, HTuple* Qy, HTuple* Qz) const;
  39. // Project a 3D point using a projective transformation matrix.
  40. double ProjectiveTransPoint3d(double Px, double Py, double Pz, double* Qy, double* Qz) const;
  41. // Apply an arbitrary affine 3D transformation to points.
  42. HTuple AffineTransPoint3d(const HTuple& Px, const HTuple& Py, const HTuple& Pz, HTuple* Qy, HTuple* Qz) const;
  43. // Apply an arbitrary affine 3D transformation to points.
  44. double AffineTransPoint3d(double Px, double Py, double Pz, double* Qy, double* Qz) const;
  45. // Approximate a 3D transformation from point correspondences.
  46. void VectorToHomMat3d(const HString& TransformationType, const HTuple& Px, const HTuple& Py, const HTuple& Pz, const HTuple& Qx, const HTuple& Qy, const HTuple& Qz);
  47. // Approximate a 3D transformation from point correspondences.
  48. void VectorToHomMat3d(const char* TransformationType, const HTuple& Px, const HTuple& Py, const HTuple& Pz, const HTuple& Qx, const HTuple& Qy, const HTuple& Qz);
  49. #ifdef _WIN32
  50. // Approximate a 3D transformation from point correspondences.
  51. void VectorToHomMat3d(const wchar_t* TransformationType, const HTuple& Px, const HTuple& Py, const HTuple& Pz, const HTuple& Qx, const HTuple& Qy, const HTuple& Qz);
  52. #endif
  53. // Compute the determinant of a homogeneous 3D transformation matrix.
  54. double HomMat3dDeterminant() const;
  55. // Transpose a homogeneous 3D transformation matrix.
  56. HHomMat3D HomMat3dTranspose() const;
  57. // Invert a homogeneous 3D transformation matrix.
  58. HHomMat3D HomMat3dInvert() const;
  59. // Multiply two homogeneous 3D transformation matrices.
  60. HHomMat3D HomMat3dCompose(const HHomMat3D& HomMat3DRight) const;
  61. // Add a rotation to a homogeneous 3D transformation matrix.
  62. HHomMat3D HomMat3dRotateLocal(const HTuple& Phi, const HTuple& Axis) const;
  63. // Add a rotation to a homogeneous 3D transformation matrix.
  64. HHomMat3D HomMat3dRotateLocal(double Phi, const HString& Axis) const;
  65. // Add a rotation to a homogeneous 3D transformation matrix.
  66. HHomMat3D HomMat3dRotateLocal(double Phi, const char* Axis) const;
  67. #ifdef _WIN32
  68. // Add a rotation to a homogeneous 3D transformation matrix.
  69. HHomMat3D HomMat3dRotateLocal(double Phi, const wchar_t* Axis) const;
  70. #endif
  71. // Add a rotation to a homogeneous 3D transformation matrix.
  72. HHomMat3D HomMat3dRotate(const HTuple& Phi, const HTuple& Axis, const HTuple& Px, const HTuple& Py, const HTuple& Pz) const;
  73. // Add a rotation to a homogeneous 3D transformation matrix.
  74. HHomMat3D HomMat3dRotate(double Phi, const HString& Axis, double Px, double Py, double Pz) const;
  75. // Add a rotation to a homogeneous 3D transformation matrix.
  76. HHomMat3D HomMat3dRotate(double Phi, const char* Axis, double Px, double Py, double Pz) const;
  77. #ifdef _WIN32
  78. // Add a rotation to a homogeneous 3D transformation matrix.
  79. HHomMat3D HomMat3dRotate(double Phi, const wchar_t* Axis, double Px, double Py, double Pz) const;
  80. #endif
  81. // Add a scaling to a homogeneous 3D transformation matrix.
  82. HHomMat3D HomMat3dScaleLocal(const HTuple& Sx, const HTuple& Sy, const HTuple& Sz) const;
  83. // Add a scaling to a homogeneous 3D transformation matrix.
  84. HHomMat3D HomMat3dScaleLocal(double Sx, double Sy, double Sz) const;
  85. // Add a scaling to a homogeneous 3D transformation matrix.
  86. HHomMat3D HomMat3dScale(const HTuple& Sx, const HTuple& Sy, const HTuple& Sz, const HTuple& Px, const HTuple& Py, const HTuple& Pz) const;
  87. // Add a scaling to a homogeneous 3D transformation matrix.
  88. HHomMat3D HomMat3dScale(double Sx, double Sy, double Sz, double Px, double Py, double Pz) const;
  89. // Add a translation to a homogeneous 3D transformation matrix.
  90. HHomMat3D HomMat3dTranslateLocal(const HTuple& Tx, const HTuple& Ty, const HTuple& Tz) const;
  91. // Add a translation to a homogeneous 3D transformation matrix.
  92. HHomMat3D HomMat3dTranslateLocal(double Tx, double Ty, double Tz) const;
  93. // Add a translation to a homogeneous 3D transformation matrix.
  94. HHomMat3D HomMat3dTranslate(const HTuple& Tx, const HTuple& Ty, const HTuple& Tz) const;
  95. // Add a translation to a homogeneous 3D transformation matrix.
  96. HHomMat3D HomMat3dTranslate(double Tx, double Ty, double Tz) const;
  97. // Generate the homogeneous transformation matrix of the identical 3D transformation.
  98. void HomMat3dIdentity();
  99. // Project an affine 3D transformation matrix to a 2D projective transformation matrix.
  100. HHomMat2D HomMat3dProject(const HTuple& PrincipalPointRow, const HTuple& PrincipalPointCol, const HTuple& Focus) const;
  101. // Project an affine 3D transformation matrix to a 2D projective transformation matrix.
  102. HHomMat2D HomMat3dProject(double PrincipalPointRow, double PrincipalPointCol, double Focus) const;
  103. // Project a homogeneous 3D point using a 3x4 projection matrix.
  104. HTuple ProjectHomPointHomMat3d(const HTuple& Px, const HTuple& Py, const HTuple& Pz, const HTuple& Pw, HTuple* Qy, HTuple* Qw) const;
  105. // Project a homogeneous 3D point using a 3x4 projection matrix.
  106. double ProjectHomPointHomMat3d(double Px, double Py, double Pz, double Pw, double* Qy, double* Qw) const;
  107. // Project a 3D point using a 3x4 projection matrix.
  108. HTuple ProjectPointHomMat3d(const HTuple& Px, const HTuple& Py, const HTuple& Pz, HTuple* Qy) const;
  109. // Project a 3D point using a 3x4 projection matrix.
  110. double ProjectPointHomMat3d(double Px, double Py, double Pz, double* Qy) const;
  111. // Convert a homogeneous transformation matrix into a 3D pose.
  112. HPose HomMat3dToPose() const;
  113. };
  114. class LIntExport HHomMat3DArray : public HDataArray
  115. {
  116. public:
  117. HHomMat3DArray();
  118. HHomMat3DArray(HHomMat3D* classes, Hlong length);
  119. /* Define a default constructor to prevent compilers that support
  120. * C++11 R-Value References v3.0 declaring an implicite move
  121. * assignment/constructor. */
  122. ~HHomMat3DArray() {}
  123. protected:
  124. virtual void CreateArray(Hlong length);
  125. virtual int GetFixedSize() const;
  126. };
  127. }
  128. #endif