HDlClassifierResult.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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_HDLCLASSIFIERRESULT
  8. #define HCPP_HDLCLASSIFIERRESULT
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a Deep Neural Network inference step result.
  12. class LIntExport HDlClassifierResult : public HHandle
  13. {
  14. public:
  15. // Create an uninitialized instance
  16. HDlClassifierResult():HHandle() {}
  17. // Copy constructor
  18. HDlClassifierResult(const HDlClassifierResult& source) : HHandle(source) {}
  19. // Copy constructor
  20. HDlClassifierResult(const HHandle& handle);
  21. // Create HDlClassifierResult from handle, taking ownership
  22. explicit HDlClassifierResult(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 ('dl_classifier_result')!
  33. virtual void AssertType(Hphandle handle) const;
  34. public:
  35. /*****************************************************************************
  36. * Operator-based class constructors
  37. *****************************************************************************/
  38. // apply_dl_classifier: Infer the class affiliations for a set of images using a deep-learning-based classifier.
  39. explicit HDlClassifierResult(const HImage& Images, const HDlClassifier& DLClassifierHandle);
  40. /***************************************************************************
  41. * Operators *
  42. ***************************************************************************/
  43. // Clear a handle containing the results of the deep-learning-based classification.
  44. static void ClearDlClassifierResult(const HDlClassifierResultArray& DLClassifierResultHandle);
  45. // Clear a handle containing the results of the deep-learning-based classification.
  46. void ClearDlClassifierResult() const;
  47. // Retrieve classification results inferred by a deep-learning-based classifier.
  48. HTuple GetDlClassifierResult(const HTuple& Index, const HTuple& GenResultName) const;
  49. // Retrieve classification results inferred by a deep-learning-based classifier.
  50. HTuple GetDlClassifierResult(const HString& Index, const HString& GenResultName) const;
  51. // Retrieve classification results inferred by a deep-learning-based classifier.
  52. HTuple GetDlClassifierResult(const char* Index, const char* GenResultName) const;
  53. #ifdef _WIN32
  54. // Retrieve classification results inferred by a deep-learning-based classifier.
  55. HTuple GetDlClassifierResult(const wchar_t* Index, const wchar_t* GenResultName) const;
  56. #endif
  57. };
  58. // forward declarations and types for internal array implementation
  59. template<class T> class HSmartPtr;
  60. template<class T> class HHandleBaseArrayRef;
  61. typedef HHandleBaseArrayRef<HDlClassifierResult> HDlClassifierResultArrayRef;
  62. typedef HSmartPtr< HDlClassifierResultArrayRef > HDlClassifierResultArrayPtr;
  63. // Represents multiple tool instances
  64. class LIntExport HDlClassifierResultArray : public HHandleBaseArray
  65. {
  66. public:
  67. // Create empty array
  68. HDlClassifierResultArray();
  69. // Create array from native array of tool instances
  70. HDlClassifierResultArray(HDlClassifierResult* classes, Hlong length);
  71. // Copy constructor
  72. HDlClassifierResultArray(const HDlClassifierResultArray &tool_array);
  73. // Destructor
  74. virtual ~HDlClassifierResultArray();
  75. // Assignment operator
  76. HDlClassifierResultArray &operator=(const HDlClassifierResultArray &tool_array);
  77. // Clears array and all tool instances
  78. virtual void Clear();
  79. // Get array of native tool instances
  80. const HDlClassifierResult* Tools() const;
  81. // Get number of tools
  82. virtual Hlong Length() const;
  83. // Create tool array from tuple of handles
  84. virtual void SetFromTuple(const HTuple& handles);
  85. // Get tuple of handles for tool array
  86. virtual HTuple ConvertToTuple() const;
  87. protected:
  88. // Smart pointer to internal data container
  89. HDlClassifierResultArrayPtr *mArrayPtr;
  90. };
  91. }
  92. #endif