HTextModel.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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_HTEXTMODEL
  8. #define HCPP_HTEXTMODEL
  9. namespace HalconCpp
  10. {
  11. // Represents an instance of a text model for text segmentation.
  12. class LIntExport HTextModel : public HHandle
  13. {
  14. public:
  15. // Copy constructor
  16. HTextModel(const HTextModel& source) : HHandle(source) {}
  17. // Copy constructor
  18. HTextModel(const HHandle& handle);
  19. // Create HTextModel from handle, taking ownership
  20. explicit HTextModel(Hlong handle);
  21. bool operator==(const HHandle& obj) const
  22. {
  23. return HHandleBase::operator==(obj);
  24. }
  25. bool operator!=(const HHandle& obj) const
  26. {
  27. return HHandleBase::operator!=(obj);
  28. }
  29. protected:
  30. // Verify matching semantic type ('text_model')!
  31. virtual void AssertType(Hphandle handle) const;
  32. public:
  33. /*****************************************************************************
  34. * Operator-based class constructors
  35. *****************************************************************************/
  36. // create_text_model_reader: Create a text model.
  37. explicit HTextModel(const HString& Mode, const HTuple& OCRClassifier);
  38. // create_text_model_reader: Create a text model.
  39. explicit HTextModel(const HString& Mode, const HString& OCRClassifier);
  40. // create_text_model_reader: Create a text model.
  41. explicit HTextModel(const char* Mode, const char* OCRClassifier);
  42. #ifdef _WIN32
  43. // create_text_model_reader: Create a text model.
  44. explicit HTextModel(const wchar_t* Mode, const wchar_t* OCRClassifier);
  45. #endif
  46. // create_text_model: Create a text model.
  47. explicit HTextModel();
  48. /***************************************************************************
  49. * Operators *
  50. ***************************************************************************/
  51. // Find text in an image.
  52. HTextResult FindText(const HImage& Image) const;
  53. // Query parameters of a text model.
  54. HTuple GetTextModelParam(const HString& GenParamName) const;
  55. // Query parameters of a text model.
  56. HTuple GetTextModelParam(const char* GenParamName) const;
  57. #ifdef _WIN32
  58. // Query parameters of a text model.
  59. HTuple GetTextModelParam(const wchar_t* GenParamName) const;
  60. #endif
  61. // Set parameters of a text model.
  62. void SetTextModelParam(const HTuple& GenParamName, const HTuple& GenParamValue) const;
  63. // Set parameters of a text model.
  64. void SetTextModelParam(const HString& GenParamName, Hlong GenParamValue) const;
  65. // Set parameters of a text model.
  66. void SetTextModelParam(const char* GenParamName, Hlong GenParamValue) const;
  67. #ifdef _WIN32
  68. // Set parameters of a text model.
  69. void SetTextModelParam(const wchar_t* GenParamName, Hlong GenParamValue) const;
  70. #endif
  71. // Clear a text model.
  72. static void ClearTextModel(const HTextModelArray& TextModel);
  73. // Clear a text model.
  74. void ClearTextModel() const;
  75. // Create a text model.
  76. void CreateTextModelReader(const HString& Mode, const HTuple& OCRClassifier);
  77. // Create a text model.
  78. void CreateTextModelReader(const HString& Mode, const HString& OCRClassifier);
  79. // Create a text model.
  80. void CreateTextModelReader(const char* Mode, const char* OCRClassifier);
  81. #ifdef _WIN32
  82. // Create a text model.
  83. void CreateTextModelReader(const wchar_t* Mode, const wchar_t* OCRClassifier);
  84. #endif
  85. // Create a text model.
  86. void CreateTextModel();
  87. };
  88. // forward declarations and types for internal array implementation
  89. template<class T> class HSmartPtr;
  90. template<class T> class HHandleBaseArrayRef;
  91. typedef HHandleBaseArrayRef<HTextModel> HTextModelArrayRef;
  92. typedef HSmartPtr< HTextModelArrayRef > HTextModelArrayPtr;
  93. // Represents multiple tool instances
  94. class LIntExport HTextModelArray : public HHandleBaseArray
  95. {
  96. public:
  97. // Create empty array
  98. HTextModelArray();
  99. // Create array from native array of tool instances
  100. HTextModelArray(HTextModel* classes, Hlong length);
  101. // Copy constructor
  102. HTextModelArray(const HTextModelArray &tool_array);
  103. // Destructor
  104. virtual ~HTextModelArray();
  105. // Assignment operator
  106. HTextModelArray &operator=(const HTextModelArray &tool_array);
  107. // Clears array and all tool instances
  108. virtual void Clear();
  109. // Get array of native tool instances
  110. const HTextModel* Tools() const;
  111. // Get number of tools
  112. virtual Hlong Length() const;
  113. // Create tool array from tuple of handles
  114. virtual void SetFromTuple(const HTuple& handles);
  115. // Get tuple of handles for tool array
  116. virtual HTuple ConvertToTuple() const;
  117. protected:
  118. // Smart pointer to internal data container
  119. HTextModelArrayPtr *mArrayPtr;
  120. };
  121. }
  122. #endif