HSheetOfLightModel.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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_HSHEETOFLIGHTMODEL
  8. #define HCPP_HSHEETOFLIGHTMODEL
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of the data structure required to perform 3D measurements with the sheet-of-light technique.
  12. class LIntExport HSheetOfLightModel : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HSheetOfLightModel():HHandle() {}
  17. // Copy constructor
  18. HSheetOfLightModel(const HSheetOfLightModel& source) : HHandle(source) {}
  19. // Copy constructor
  20. HSheetOfLightModel(const HHandle& handle);
  21. // Create HSheetOfLightModel from handle, taking ownership
  22. explicit HSheetOfLightModel(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 ('sheet_of_light_model')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. // Deep copy of all data represented by this object instance
  36. HSheetOfLightModel Clone() const;
  37. /*****************************************************************************
  38. * Operator-based class constructors
  39. *****************************************************************************/
  40. // read_sheet_of_light_model: Read a sheet-of-light model from a file and create a new model.
  41. explicit HSheetOfLightModel(const HString& FileName);
  42. // read_sheet_of_light_model: Read a sheet-of-light model from a file and create a new model.
  43. explicit HSheetOfLightModel(const char* FileName);
  44. #ifdef _WIN32
  45. // read_sheet_of_light_model: Read a sheet-of-light model from a file and create a new model.
  46. explicit HSheetOfLightModel(const wchar_t* FileName);
  47. #endif
  48. // create_sheet_of_light_model: Create a model to perform 3D-measurements using the sheet-of-light technique.
  49. explicit HSheetOfLightModel(const HRegion& ProfileRegion, const HTuple& GenParamName, const HTuple& GenParamValue);
  50. // create_sheet_of_light_model: Create a model to perform 3D-measurements using the sheet-of-light technique.
  51. explicit HSheetOfLightModel(const HRegion& ProfileRegion, const HString& GenParamName, Hlong GenParamValue);
  52. // create_sheet_of_light_model: Create a model to perform 3D-measurements using the sheet-of-light technique.
  53. explicit HSheetOfLightModel(const HRegion& ProfileRegion, const char* GenParamName, Hlong GenParamValue);
  54. #ifdef _WIN32
  55. // create_sheet_of_light_model: Create a model to perform 3D-measurements using the sheet-of-light technique.
  56. explicit HSheetOfLightModel(const HRegion& ProfileRegion, const wchar_t* GenParamName, Hlong GenParamValue);
  57. #endif
  58. /***************************************************************************
  59. * Operators *
  60. ***************************************************************************/
  61. // Read a sheet-of-light model from a file and create a new model.
  62. void ReadSheetOfLightModel(const HString& FileName);
  63. // Read a sheet-of-light model from a file and create a new model.
  64. void ReadSheetOfLightModel(const char* FileName);
  65. #ifdef _WIN32
  66. // Read a sheet-of-light model from a file and create a new model.
  67. void ReadSheetOfLightModel(const wchar_t* FileName);
  68. #endif
  69. // Write a sheet-of-light model to a file.
  70. void WriteSheetOfLightModel(const HString& FileName) const;
  71. // Write a sheet-of-light model to a file.
  72. void WriteSheetOfLightModel(const char* FileName) const;
  73. #ifdef _WIN32
  74. // Write a sheet-of-light model to a file.
  75. void WriteSheetOfLightModel(const wchar_t* FileName) const;
  76. #endif
  77. // Deserialize a sheet-of-light model.
  78. void DeserializeSheetOfLightModel(const HSerializedItem& SerializedItemHandle);
  79. // Serialize a sheet-of-light model.
  80. HSerializedItem SerializeSheetOfLightModel() const;
  81. // Calibrate a sheet-of-light setup with a 3D calibration object.
  82. double CalibrateSheetOfLight() const;
  83. // Get the result of a calibrated measurement performed with the sheet-of-light technique as a 3D object model.
  84. HObjectModel3D GetSheetOfLightResultObjectModel3d() const;
  85. // Get the iconic results of a measurement performed with the sheet-of light technique.
  86. HImage GetSheetOfLightResult(const HTuple& ResultName) const;
  87. // Get the iconic results of a measurement performed with the sheet-of light technique.
  88. HImage GetSheetOfLightResult(const HString& ResultName) const;
  89. // Get the iconic results of a measurement performed with the sheet-of light technique.
  90. HImage GetSheetOfLightResult(const char* ResultName) const;
  91. #ifdef _WIN32
  92. // Get the iconic results of a measurement performed with the sheet-of light technique.
  93. HImage GetSheetOfLightResult(const wchar_t* ResultName) const;
  94. #endif
  95. // Apply the calibration transformations to the input disparity image.
  96. void ApplySheetOfLightCalibration(const HImage& Disparity) const;
  97. // Set sheet of light profiles by measured disparities.
  98. void SetProfileSheetOfLight(const HImage& ProfileDisparityImage, const HTuple& MovementPoses) const;
  99. // Process the profile image provided as input and store the resulting disparity to the sheet-of-light model.
  100. void MeasureProfileSheetOfLight(const HImage& ProfileImage, const HTuple& MovementPose) const;
  101. // Set selected parameters of the sheet-of-light model.
  102. void SetSheetOfLightParam(const HString& GenParamName, const HTuple& GenParamValue) const;
  103. // Set selected parameters of the sheet-of-light model.
  104. void SetSheetOfLightParam(const HString& GenParamName, const HString& GenParamValue) const;
  105. // Set selected parameters of the sheet-of-light model.
  106. void SetSheetOfLightParam(const char* GenParamName, const char* GenParamValue) const;
  107. #ifdef _WIN32
  108. // Set selected parameters of the sheet-of-light model.
  109. void SetSheetOfLightParam(const wchar_t* GenParamName, const wchar_t* GenParamValue) const;
  110. #endif
  111. // Get the value of a parameter, which has been set in a sheet-of-light model.
  112. HTuple GetSheetOfLightParam(const HString& GenParamName) const;
  113. // Get the value of a parameter, which has been set in a sheet-of-light model.
  114. HTuple GetSheetOfLightParam(const char* GenParamName) const;
  115. #ifdef _WIN32
  116. // Get the value of a parameter, which has been set in a sheet-of-light model.
  117. HTuple GetSheetOfLightParam(const wchar_t* GenParamName) const;
  118. #endif
  119. // For a given sheet-of-light model get the names of the generic iconic or control parameters that can be used in the different sheet-of-light operators.
  120. HTuple QuerySheetOfLightParams(const HString& QueryName) const;
  121. // For a given sheet-of-light model get the names of the generic iconic or control parameters that can be used in the different sheet-of-light operators.
  122. HTuple QuerySheetOfLightParams(const char* QueryName) const;
  123. #ifdef _WIN32
  124. // For a given sheet-of-light model get the names of the generic iconic or control parameters that can be used in the different sheet-of-light operators.
  125. HTuple QuerySheetOfLightParams(const wchar_t* QueryName) const;
  126. #endif
  127. // Reset a sheet-of-light model.
  128. void ResetSheetOfLightModel() const;
  129. // Delete a sheet-of-light model and free the allocated memory.
  130. void ClearSheetOfLightModel() const;
  131. // Create a model to perform 3D-measurements using the sheet-of-light technique.
  132. void CreateSheetOfLightModel(const HRegion& ProfileRegion, const HTuple& GenParamName, const HTuple& GenParamValue);
  133. // Create a model to perform 3D-measurements using the sheet-of-light technique.
  134. void CreateSheetOfLightModel(const HRegion& ProfileRegion, const HString& GenParamName, Hlong GenParamValue);
  135. // Create a model to perform 3D-measurements using the sheet-of-light technique.
  136. void CreateSheetOfLightModel(const HRegion& ProfileRegion, const char* GenParamName, Hlong GenParamValue);
  137. #ifdef _WIN32
  138. // Create a model to perform 3D-measurements using the sheet-of-light technique.
  139. void CreateSheetOfLightModel(const HRegion& ProfileRegion, const wchar_t* GenParamName, Hlong GenParamValue);
  140. #endif
  141. };
  142. // forward declarations and types for internal array implementation
  143. template<class T> class HSmartPtr;
  144. template<class T> class HHandleBaseArrayRef;
  145. typedef HHandleBaseArrayRef<HSheetOfLightModel> HSheetOfLightModelArrayRef;
  146. typedef HSmartPtr< HSheetOfLightModelArrayRef > HSheetOfLightModelArrayPtr;
  147. // Represents multiple tool instances
  148. class LIntExport HSheetOfLightModelArray : public HHandleBaseArray
  149. {
  150. public:
  151. // Create empty array
  152. HSheetOfLightModelArray();
  153. // Create array from native array of tool instances
  154. HSheetOfLightModelArray(HSheetOfLightModel* classes, Hlong length);
  155. // Copy constructor
  156. HSheetOfLightModelArray(const HSheetOfLightModelArray &tool_array);
  157. // Destructor
  158. virtual ~HSheetOfLightModelArray();
  159. // Assignment operator
  160. HSheetOfLightModelArray &operator=(const HSheetOfLightModelArray &tool_array);
  161. // Clears array and all tool instances
  162. virtual void Clear();
  163. // Get array of native tool instances
  164. const HSheetOfLightModel* Tools() const;
  165. // Get number of tools
  166. virtual Hlong Length() const;
  167. // Create tool array from tuple of handles
  168. virtual void SetFromTuple(const HTuple& handles);
  169. // Get tuple of handles for tool array
  170. virtual HTuple ConvertToTuple() const;
  171. protected:
  172. // Smart pointer to internal data container
  173. HSheetOfLightModelArrayPtr *mArrayPtr;
  174. };
  175. }
  176. #endif