OCRHMMDecoder.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. //
  2. // This file is auto-generated. Please don't modify it!
  3. //
  4. #pragma once
  5. #ifdef __cplusplus
  6. //#import "opencv.hpp"
  7. #import "opencv2/text.hpp"
  8. #import "opencv2/text/ocr.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. #import "BaseOCR.h"
  14. #import "Text.h"
  15. @class Mat;
  16. @class OCRHMMDecoderClassifierCallback;
  17. NS_ASSUME_NONNULL_BEGIN
  18. // C++: class OCRHMMDecoder
  19. /**
  20. * OCRHMMDecoder class provides an interface for OCR using Hidden Markov Models.
  21. *
  22. * NOTE:
  23. * - (C++) An example on using OCRHMMDecoder recognition combined with scene text detection can
  24. * be found at the webcam_demo sample:
  25. * <https://github.com/opencv/opencv_contrib/blob/master/modules/text/samples/webcam_demo.cpp>
  26. *
  27. * Member of `Text`
  28. */
  29. CV_EXPORTS @interface OCRHMMDecoder : BaseOCR
  30. #ifdef __cplusplus
  31. @property(readonly)cv::Ptr<cv::text::OCRHMMDecoder> nativePtrOCRHMMDecoder;
  32. #endif
  33. #ifdef __cplusplus
  34. - (instancetype)initWithNativePtr:(cv::Ptr<cv::text::OCRHMMDecoder>)nativePtr;
  35. + (instancetype)fromNative:(cv::Ptr<cv::text::OCRHMMDecoder>)nativePtr;
  36. #endif
  37. #pragma mark - Methods
  38. //
  39. // String cv::text::OCRHMMDecoder::run(Mat image, int min_confidence, int component_level = 0)
  40. //
  41. /**
  42. * Recognize text using HMM.
  43. *
  44. * Takes an image and a mask (where each connected component corresponds to a segmented character)
  45. * on input and returns recognized text in the output_text parameter. Optionally
  46. * provides also the Rects for individual text elements found (e.g. words), and the list of those
  47. * text elements with their confidence values.
  48. *
  49. * @param image Input image CV_8UC1 or CV_8UC3 with a single text line (or word).
  50. *
  51. *
  52. * text elements found (e.g. words).
  53. *
  54. * recognition of individual text elements found (e.g. words).
  55. *
  56. * for the recognition of individual text elements found (e.g. words).
  57. *
  58. * @param component_level Only OCR_LEVEL_WORD is supported.
  59. */
  60. - (NSString*)run:(Mat*)image min_confidence:(int)min_confidence component_level:(int)component_level NS_SWIFT_NAME(run(image:min_confidence:component_level:));
  61. /**
  62. * Recognize text using HMM.
  63. *
  64. * Takes an image and a mask (where each connected component corresponds to a segmented character)
  65. * on input and returns recognized text in the output_text parameter. Optionally
  66. * provides also the Rects for individual text elements found (e.g. words), and the list of those
  67. * text elements with their confidence values.
  68. *
  69. * @param image Input image CV_8UC1 or CV_8UC3 with a single text line (or word).
  70. *
  71. *
  72. * text elements found (e.g. words).
  73. *
  74. * recognition of individual text elements found (e.g. words).
  75. *
  76. * for the recognition of individual text elements found (e.g. words).
  77. *
  78. */
  79. - (NSString*)run:(Mat*)image min_confidence:(int)min_confidence NS_SWIFT_NAME(run(image:min_confidence:));
  80. //
  81. // String cv::text::OCRHMMDecoder::run(Mat image, Mat mask, int min_confidence, int component_level = 0)
  82. //
  83. - (NSString*)run:(Mat*)image mask:(Mat*)mask min_confidence:(int)min_confidence component_level:(int)component_level NS_SWIFT_NAME(run(image:mask:min_confidence:component_level:));
  84. - (NSString*)run:(Mat*)image mask:(Mat*)mask min_confidence:(int)min_confidence NS_SWIFT_NAME(run(image:mask:min_confidence:));
  85. //
  86. // static Ptr_OCRHMMDecoder cv::text::OCRHMMDecoder::create(Ptr_OCRHMMDecoder_ClassifierCallback classifier, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table, decoder_mode mode = OCR_DECODER_VITERBI)
  87. //
  88. /**
  89. * Creates an instance of the OCRHMMDecoder class. Initializes HMMDecoder.
  90. *
  91. * @param classifier The character classifier with built in feature extractor.
  92. *
  93. * @param vocabulary The language vocabulary (chars when ascii english text). vocabulary.size()
  94. * must be equal to the number of classes of the classifier.
  95. *
  96. * @param transition_probabilities_table Table with transition probabilities between character
  97. * pairs. cols == rows == vocabulary.size().
  98. *
  99. * @param emission_probabilities_table Table with observation emission probabilities. cols ==
  100. * rows == vocabulary.size().
  101. *
  102. * @param mode HMM Decoding algorithm. Only OCR_DECODER_VITERBI is available for the moment
  103. * (<http://en.wikipedia.org/wiki/Viterbi_algorithm>).
  104. */
  105. + (OCRHMMDecoder*)create:(OCRHMMDecoderClassifierCallback*)classifier vocabulary:(NSString*)vocabulary transition_probabilities_table:(Mat*)transition_probabilities_table emission_probabilities_table:(Mat*)emission_probabilities_table mode:(decoder_mode)mode NS_SWIFT_NAME(create(classifier:vocabulary:transition_probabilities_table:emission_probabilities_table:mode:));
  106. /**
  107. * Creates an instance of the OCRHMMDecoder class. Initializes HMMDecoder.
  108. *
  109. * @param classifier The character classifier with built in feature extractor.
  110. *
  111. * @param vocabulary The language vocabulary (chars when ascii english text). vocabulary.size()
  112. * must be equal to the number of classes of the classifier.
  113. *
  114. * @param transition_probabilities_table Table with transition probabilities between character
  115. * pairs. cols == rows == vocabulary.size().
  116. *
  117. * @param emission_probabilities_table Table with observation emission probabilities. cols ==
  118. * rows == vocabulary.size().
  119. *
  120. * (<http://en.wikipedia.org/wiki/Viterbi_algorithm>).
  121. */
  122. + (OCRHMMDecoder*)create:(OCRHMMDecoderClassifierCallback*)classifier vocabulary:(NSString*)vocabulary transition_probabilities_table:(Mat*)transition_probabilities_table emission_probabilities_table:(Mat*)emission_probabilities_table NS_SWIFT_NAME(create(classifier:vocabulary:transition_probabilities_table:emission_probabilities_table:));
  123. //
  124. // static Ptr_OCRHMMDecoder cv::text::OCRHMMDecoder::create(String filename, String vocabulary, Mat transition_probabilities_table, Mat emission_probabilities_table, decoder_mode mode = OCR_DECODER_VITERBI, int classifier = OCR_KNN_CLASSIFIER)
  125. //
  126. /**
  127. * Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path
  128. *
  129. *
  130. */
  131. + (OCRHMMDecoder*)createFromFile:(NSString*)filename vocabulary:(NSString*)vocabulary transition_probabilities_table:(Mat*)transition_probabilities_table emission_probabilities_table:(Mat*)emission_probabilities_table mode:(decoder_mode)mode classifier:(int)classifier NS_SWIFT_NAME(create(filename:vocabulary:transition_probabilities_table:emission_probabilities_table:mode:classifier:));
  132. /**
  133. * Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path
  134. *
  135. *
  136. */
  137. + (OCRHMMDecoder*)createFromFile:(NSString*)filename vocabulary:(NSString*)vocabulary transition_probabilities_table:(Mat*)transition_probabilities_table emission_probabilities_table:(Mat*)emission_probabilities_table mode:(decoder_mode)mode NS_SWIFT_NAME(create(filename:vocabulary:transition_probabilities_table:emission_probabilities_table:mode:));
  138. /**
  139. * Creates an instance of the OCRHMMDecoder class. Loads and initializes HMMDecoder from the specified path
  140. *
  141. *
  142. */
  143. + (OCRHMMDecoder*)createFromFile:(NSString*)filename vocabulary:(NSString*)vocabulary transition_probabilities_table:(Mat*)transition_probabilities_table emission_probabilities_table:(Mat*)emission_probabilities_table NS_SWIFT_NAME(create(filename:vocabulary:transition_probabilities_table:emission_probabilities_table:));
  144. @end
  145. NS_ASSUME_NONNULL_END