HDescriptorModel.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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_HDESCRIPTORMODEL
  8. #define HCPP_HDESCRIPTORMODEL
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a descriptor model.
  12. class LIntExport HDescriptorModel : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HDescriptorModel():HHandle() {}
  17. // Copy constructor
  18. HDescriptorModel(const HDescriptorModel& source) : HHandle(source) {}
  19. // Copy constructor
  20. HDescriptorModel(const HHandle& handle);
  21. // Create HDescriptorModel from handle, taking ownership
  22. explicit HDescriptorModel(Hlong handle);
  23. bool operator==(const HHandle& obj) const
  24. {
  25. return HHandleBase::operator==(obj);
  26. }
  27. bool operator!=(const HHandle& obj) const
  28. {
  29. return HHandleBase::operator!=(obj);
  30. }
  31. protected:
  32. // Verify matching semantic type ('descriptor_model')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. // Deep copy of all data represented by this object instance
  36. HDescriptorModel Clone() const;
  37. /*****************************************************************************
  38. * Operator-based class constructors
  39. *****************************************************************************/
  40. // read_descriptor_model: Read a descriptor model from a file.
  41. explicit HDescriptorModel(const HString& FileName);
  42. // read_descriptor_model: Read a descriptor model from a file.
  43. explicit HDescriptorModel(const char* FileName);
  44. #ifdef _WIN32
  45. // read_descriptor_model: Read a descriptor model from a file.
  46. explicit HDescriptorModel(const wchar_t* FileName);
  47. #endif
  48. // create_calib_descriptor_model: Create a descriptor model for calibrated perspective matching.
  49. explicit HDescriptorModel(const HImage& Template, const HCamPar& CamParam, const HPose& ReferencePose, const HString& DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  50. // create_calib_descriptor_model: Create a descriptor model for calibrated perspective matching.
  51. explicit HDescriptorModel(const HImage& Template, const HCamPar& CamParam, const HPose& ReferencePose, const char* DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  52. #ifdef _WIN32
  53. // create_calib_descriptor_model: Create a descriptor model for calibrated perspective matching.
  54. explicit HDescriptorModel(const HImage& Template, const HCamPar& CamParam, const HPose& ReferencePose, const wchar_t* DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  55. #endif
  56. // create_uncalib_descriptor_model: Prepare a descriptor model for interest point matching.
  57. explicit HDescriptorModel(const HImage& Template, const HString& DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  58. // create_uncalib_descriptor_model: Prepare a descriptor model for interest point matching.
  59. explicit HDescriptorModel(const HImage& Template, const char* DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  60. #ifdef _WIN32
  61. // create_uncalib_descriptor_model: Prepare a descriptor model for interest point matching.
  62. explicit HDescriptorModel(const HImage& Template, const wchar_t* DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  63. #endif
  64. /***************************************************************************
  65. * Operators *
  66. ***************************************************************************/
  67. // Free the memory of a descriptor model.
  68. static void ClearDescriptorModel(const HDescriptorModelArray& ModelID);
  69. // Free the memory of a descriptor model.
  70. void ClearDescriptorModel() const;
  71. // Deserialize a descriptor model.
  72. void DeserializeDescriptorModel(const HSerializedItem& SerializedItemHandle);
  73. // Serialize a descriptor model.
  74. HSerializedItem SerializeDescriptorModel() const;
  75. // Read a descriptor model from a file.
  76. void ReadDescriptorModel(const HString& FileName);
  77. // Read a descriptor model from a file.
  78. void ReadDescriptorModel(const char* FileName);
  79. #ifdef _WIN32
  80. // Read a descriptor model from a file.
  81. void ReadDescriptorModel(const wchar_t* FileName);
  82. #endif
  83. // Write a descriptor model to a file.
  84. void WriteDescriptorModel(const HString& FileName) const;
  85. // Write a descriptor model to a file.
  86. void WriteDescriptorModel(const char* FileName) const;
  87. #ifdef _WIN32
  88. // Write a descriptor model to a file.
  89. void WriteDescriptorModel(const wchar_t* FileName) const;
  90. #endif
  91. // Find the best matches of a calibrated descriptor model in an image and return their 3D pose.
  92. HPoseArray FindCalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, const HTuple& MinScore, Hlong NumMatches, const HCamPar& CamParam, const HTuple& ScoreType, HTuple* Score) const;
  93. // Find the best matches of a calibrated descriptor model in an image and return their 3D pose.
  94. HPose FindCalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const HString& ScoreType, double* Score) const;
  95. // Find the best matches of a calibrated descriptor model in an image and return their 3D pose.
  96. HPose FindCalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const char* ScoreType, double* Score) const;
  97. #ifdef _WIN32
  98. // Find the best matches of a calibrated descriptor model in an image and return their 3D pose.
  99. HPose FindCalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HCamPar& CamParam, const wchar_t* ScoreType, double* Score) const;
  100. #endif
  101. // Find the best matches of a descriptor model in an image.
  102. HHomMat2DArray FindUncalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, const HTuple& MinScore, Hlong NumMatches, const HTuple& ScoreType, HTuple* Score) const;
  103. // Find the best matches of a descriptor model in an image.
  104. HHomMat2D FindUncalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const HString& ScoreType, double* Score) const;
  105. // Find the best matches of a descriptor model in an image.
  106. HHomMat2D FindUncalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const char* ScoreType, double* Score) const;
  107. #ifdef _WIN32
  108. // Find the best matches of a descriptor model in an image.
  109. HHomMat2D FindUncalibDescriptorModel(const HImage& Image, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, double MinScore, Hlong NumMatches, const wchar_t* ScoreType, double* Score) const;
  110. #endif
  111. // Query the interest points of the descriptor model or the last processed search image.
  112. void GetDescriptorModelPoints(const HString& Set, const HTuple& Subset, HTuple* Row, HTuple* Column) const;
  113. // Query the interest points of the descriptor model or the last processed search image.
  114. void GetDescriptorModelPoints(const HString& Set, Hlong Subset, HTuple* Row, HTuple* Column) const;
  115. // Query the interest points of the descriptor model or the last processed search image.
  116. void GetDescriptorModelPoints(const char* Set, Hlong Subset, HTuple* Row, HTuple* Column) const;
  117. #ifdef _WIN32
  118. // Query the interest points of the descriptor model or the last processed search image.
  119. void GetDescriptorModelPoints(const wchar_t* Set, Hlong Subset, HTuple* Row, HTuple* Column) const;
  120. #endif
  121. // Return the parameters of a descriptor model.
  122. HString GetDescriptorModelParams(HTuple* DetectorParamName, HTuple* DetectorParamValue, HTuple* DescriptorParamName, HTuple* DescriptorParamValue) const;
  123. // Create a descriptor model for calibrated perspective matching.
  124. void CreateCalibDescriptorModel(const HImage& Template, const HCamPar& CamParam, const HPose& ReferencePose, const HString& DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  125. // Create a descriptor model for calibrated perspective matching.
  126. void CreateCalibDescriptorModel(const HImage& Template, const HCamPar& CamParam, const HPose& ReferencePose, const char* DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  127. #ifdef _WIN32
  128. // Create a descriptor model for calibrated perspective matching.
  129. void CreateCalibDescriptorModel(const HImage& Template, const HCamPar& CamParam, const HPose& ReferencePose, const wchar_t* DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  130. #endif
  131. // Prepare a descriptor model for interest point matching.
  132. void CreateUncalibDescriptorModel(const HImage& Template, const HString& DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  133. // Prepare a descriptor model for interest point matching.
  134. void CreateUncalibDescriptorModel(const HImage& Template, const char* DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  135. #ifdef _WIN32
  136. // Prepare a descriptor model for interest point matching.
  137. void CreateUncalibDescriptorModel(const HImage& Template, const wchar_t* DetectorType, const HTuple& DetectorParamName, const HTuple& DetectorParamValue, const HTuple& DescriptorParamName, const HTuple& DescriptorParamValue, Hlong Seed);
  138. #endif
  139. // Query alphanumerical results that were accumulated during descriptor-based matching.
  140. HTuple GetDescriptorModelResults(const HTuple& ObjectID, const HString& ResultNames) const;
  141. // Query alphanumerical results that were accumulated during descriptor-based matching.
  142. HTuple GetDescriptorModelResults(Hlong ObjectID, const HString& ResultNames) const;
  143. // Query alphanumerical results that were accumulated during descriptor-based matching.
  144. HTuple GetDescriptorModelResults(Hlong ObjectID, const char* ResultNames) const;
  145. #ifdef _WIN32
  146. // Query alphanumerical results that were accumulated during descriptor-based matching.
  147. HTuple GetDescriptorModelResults(Hlong ObjectID, const wchar_t* ResultNames) const;
  148. #endif
  149. // Return the origin of a descriptor model.
  150. void GetDescriptorModelOrigin(HTuple* Row, HTuple* Column) const;
  151. // Return the origin of a descriptor model.
  152. void GetDescriptorModelOrigin(double* Row, double* Column) const;
  153. // Sets the origin of a descriptor model.
  154. void SetDescriptorModelOrigin(const HTuple& Row, const HTuple& Column) const;
  155. // Sets the origin of a descriptor model.
  156. void SetDescriptorModelOrigin(double Row, double Column) const;
  157. };
  158. // forward declarations and types for internal array implementation
  159. template<class T> class HSmartPtr;
  160. template<class T> class HHandleBaseArrayRef;
  161. typedef HHandleBaseArrayRef<HDescriptorModel> HDescriptorModelArrayRef;
  162. typedef HSmartPtr< HDescriptorModelArrayRef > HDescriptorModelArrayPtr;
  163. // Represents multiple tool instances
  164. class LIntExport HDescriptorModelArray : public HHandleBaseArray
  165. {
  166. public:
  167. // Create empty array
  168. HDescriptorModelArray();
  169. // Create array from native array of tool instances
  170. HDescriptorModelArray(HDescriptorModel* classes, Hlong length);
  171. // Copy constructor
  172. HDescriptorModelArray(const HDescriptorModelArray &tool_array);
  173. // Destructor
  174. virtual ~HDescriptorModelArray();
  175. // Assignment operator
  176. HDescriptorModelArray &operator=(const HDescriptorModelArray &tool_array);
  177. // Clears array and all tool instances
  178. virtual void Clear();
  179. // Get array of native tool instances
  180. const HDescriptorModel* Tools() const;
  181. // Get number of tools
  182. virtual Hlong Length() const;
  183. // Create tool array from tuple of handles
  184. virtual void SetFromTuple(const HTuple& handles);
  185. // Get tuple of handles for tool array
  186. virtual HTuple ConvertToTuple() const;
  187. protected:
  188. // Smart pointer to internal data container
  189. HDescriptorModelArrayPtr *mArrayPtr;
  190. };
  191. }
  192. #endif