HTextureInspectionResult.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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_HTEXTUREINSPECTIONRESULT
  8. #define HCPP_HTEXTUREINSPECTIONRESULT
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a texture inspection result.
  12. class LIntExport HTextureInspectionResult : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HTextureInspectionResult():HHandle() {}
  17. // Copy constructor
  18. HTextureInspectionResult(const HTextureInspectionResult& source) : HHandle(source) {}
  19. // Copy constructor
  20. HTextureInspectionResult(const HHandle& handle);
  21. // Create HTextureInspectionResult from handle, taking ownership
  22. explicit HTextureInspectionResult(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 ('texture_inspection_result')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. /*****************************************************************************
  36. * Operator-based class constructors
  37. *****************************************************************************/
  38. // apply_texture_inspection_model: Inspection of the texture within an image.
  39. explicit HTextureInspectionResult(const HImage& Image, HRegion* NoveltyRegion, const HTextureInspectionModel& TextureInspectionModel);
  40. /***************************************************************************
  41. * Operators *
  42. ***************************************************************************/
  43. // Add training images to the texture inspection model.
  44. static HTuple AddTextureInspectionModelImage(const HImage& Image, const HTextureInspectionModel& TextureInspectionModel);
  45. // Inspection of the texture within an image.
  46. HRegion ApplyTextureInspectionModel(const HImage& Image, const HTextureInspectionModel& TextureInspectionModel);
  47. // Clear a texture inspection result handle and free the allocated memory.
  48. static void ClearTextureInspectionResult(const HTextureInspectionResultArray& TextureInspectionResultID);
  49. // Clear a texture inspection result handle and free the allocated memory.
  50. void ClearTextureInspectionResult() const;
  51. // Get the training images contained in a texture inspection model.
  52. static HImage GetTextureInspectionModelImage(const HTextureInspectionModel& TextureInspectionModel);
  53. // Query iconic results of a texture inspection.
  54. HObject GetTextureInspectionResultObject(const HTuple& ResultName) const;
  55. // Query iconic results of a texture inspection.
  56. HObject GetTextureInspectionResultObject(const HString& ResultName) const;
  57. // Query iconic results of a texture inspection.
  58. HObject GetTextureInspectionResultObject(const char* ResultName) const;
  59. #ifdef _WIN32
  60. // Query iconic results of a texture inspection.
  61. HObject GetTextureInspectionResultObject(const wchar_t* ResultName) const;
  62. #endif
  63. // Train a texture inspection model.
  64. static void TrainTextureInspectionModel(const HTextureInspectionModel& TextureInspectionModel);
  65. };
  66. // forward declarations and types for internal array implementation
  67. template<class T> class HSmartPtr;
  68. template<class T> class HHandleBaseArrayRef;
  69. typedef HHandleBaseArrayRef<HTextureInspectionResult> HTextureInspectionResultArrayRef;
  70. typedef HSmartPtr< HTextureInspectionResultArrayRef > HTextureInspectionResultArrayPtr;
  71. // Represents multiple tool instances
  72. class LIntExport HTextureInspectionResultArray : public HHandleBaseArray
  73. {
  74. public:
  75. // Create empty array
  76. HTextureInspectionResultArray();
  77. // Create array from native array of tool instances
  78. HTextureInspectionResultArray(HTextureInspectionResult* classes, Hlong length);
  79. // Copy constructor
  80. HTextureInspectionResultArray(const HTextureInspectionResultArray &tool_array);
  81. // Destructor
  82. virtual ~HTextureInspectionResultArray();
  83. // Assignment operator
  84. HTextureInspectionResultArray &operator=(const HTextureInspectionResultArray &tool_array);
  85. // Clears array and all tool instances
  86. virtual void Clear();
  87. // Get array of native tool instances
  88. const HTextureInspectionResult* Tools() const;
  89. // Get number of tools
  90. virtual Hlong Length() const;
  91. // Create tool array from tuple of handles
  92. virtual void SetFromTuple(const HTuple& handles);
  93. // Get tuple of handles for tool array
  94. virtual HTuple ConvertToTuple() const;
  95. protected:
  96. // Smart pointer to internal data container
  97. HTextureInspectionResultArrayPtr *mArrayPtr;
  98. };
  99. }
  100. #endif