WeChatQRCode.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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/wechat_qrcode.hpp"
  8. #else
  9. #define CV_EXPORTS
  10. #endif
  11. #import <Foundation/Foundation.h>
  12. @class Mat;
  13. NS_ASSUME_NONNULL_BEGIN
  14. // C++: class WeChatQRCode
  15. /**
  16. * WeChat QRCode includes two CNN-based models:
  17. * A object detection model and a super resolution model.
  18. * Object detection model is applied to detect QRCode with the bounding box.
  19. * super resolution model is applied to zoom in QRCode when it is small.
  20. *
  21. *
  22. * Member of `Wechat_qrcode`
  23. */
  24. CV_EXPORTS @interface WeChatQRCode : NSObject
  25. #ifdef __cplusplus
  26. @property(readonly)cv::Ptr<cv::wechat_qrcode::WeChatQRCode> nativePtr;
  27. #endif
  28. #ifdef __cplusplus
  29. - (instancetype)initWithNativePtr:(cv::Ptr<cv::wechat_qrcode::WeChatQRCode>)nativePtr;
  30. + (instancetype)fromNative:(cv::Ptr<cv::wechat_qrcode::WeChatQRCode>)nativePtr;
  31. #endif
  32. #pragma mark - Methods
  33. //
  34. // cv::wechat_qrcode::WeChatQRCode::WeChatQRCode(string detector_prototxt_path = "", string detector_caffe_model_path = "", string super_resolution_prototxt_path = "", string super_resolution_caffe_model_path = "")
  35. //
  36. /**
  37. * Initialize the WeChatQRCode.
  38. * It includes two models, which are packaged with caffe format.
  39. * Therefore, there are prototxt and caffe models (In total, four paramenters).
  40. *
  41. * @param detector_prototxt_path prototxt file path for the detector
  42. * @param detector_caffe_model_path caffe model file path for the detector
  43. * @param super_resolution_prototxt_path prototxt file path for the super resolution model
  44. * @param super_resolution_caffe_model_path caffe file path for the super resolution model
  45. */
  46. - (instancetype)initWithDetector_prototxt_path:(NSString*)detector_prototxt_path detector_caffe_model_path:(NSString*)detector_caffe_model_path super_resolution_prototxt_path:(NSString*)super_resolution_prototxt_path super_resolution_caffe_model_path:(NSString*)super_resolution_caffe_model_path;
  47. /**
  48. * Initialize the WeChatQRCode.
  49. * It includes two models, which are packaged with caffe format.
  50. * Therefore, there are prototxt and caffe models (In total, four paramenters).
  51. *
  52. * @param detector_prototxt_path prototxt file path for the detector
  53. * @param detector_caffe_model_path caffe model file path for the detector
  54. * @param super_resolution_prototxt_path prototxt file path for the super resolution model
  55. */
  56. - (instancetype)initWithDetector_prototxt_path:(NSString*)detector_prototxt_path detector_caffe_model_path:(NSString*)detector_caffe_model_path super_resolution_prototxt_path:(NSString*)super_resolution_prototxt_path;
  57. /**
  58. * Initialize the WeChatQRCode.
  59. * It includes two models, which are packaged with caffe format.
  60. * Therefore, there are prototxt and caffe models (In total, four paramenters).
  61. *
  62. * @param detector_prototxt_path prototxt file path for the detector
  63. * @param detector_caffe_model_path caffe model file path for the detector
  64. */
  65. - (instancetype)initWithDetector_prototxt_path:(NSString*)detector_prototxt_path detector_caffe_model_path:(NSString*)detector_caffe_model_path;
  66. /**
  67. * Initialize the WeChatQRCode.
  68. * It includes two models, which are packaged with caffe format.
  69. * Therefore, there are prototxt and caffe models (In total, four paramenters).
  70. *
  71. * @param detector_prototxt_path prototxt file path for the detector
  72. */
  73. - (instancetype)initWithDetector_prototxt_path:(NSString*)detector_prototxt_path;
  74. /**
  75. * Initialize the WeChatQRCode.
  76. * It includes two models, which are packaged with caffe format.
  77. * Therefore, there are prototxt and caffe models (In total, four paramenters).
  78. *
  79. */
  80. - (instancetype)init;
  81. //
  82. // vector_string cv::wechat_qrcode::WeChatQRCode::detectAndDecode(Mat img, vector_Mat& points = vector_Mat())
  83. //
  84. /**
  85. * Both detects and decodes QR code.
  86. * To simplify the usage, there is a only API: detectAndDecode
  87. *
  88. * @param img supports grayscale or color (BGR) image.
  89. * @param points optional output array of vertices of the found QR code quadrangle. Will be
  90. * empty if not found.
  91. * @return list of decoded string.
  92. */
  93. - (NSArray<NSString*>*)detectAndDecode:(Mat*)img points:(NSMutableArray<Mat*>*)points NS_SWIFT_NAME(detectAndDecode(img:points:));
  94. /**
  95. * Both detects and decodes QR code.
  96. * To simplify the usage, there is a only API: detectAndDecode
  97. *
  98. * @param img supports grayscale or color (BGR) image.
  99. * empty if not found.
  100. * @return list of decoded string.
  101. */
  102. - (NSArray<NSString*>*)detectAndDecode:(Mat*)img NS_SWIFT_NAME(detectAndDecode(img:));
  103. //
  104. // void cv::wechat_qrcode::WeChatQRCode::setScaleFactor(float _scalingFactor)
  105. //
  106. /**
  107. * set scale factor
  108. * QR code detector use neural network to detect QR.
  109. * Before running the neural network, the input image is pre-processed by scaling.
  110. * By default, the input image is scaled to an image with an area of 160000 pixels.
  111. * The scale factor allows to use custom scale the input image:
  112. * width = scaleFactor*width
  113. * height = scaleFactor*width
  114. *
  115. * scaleFactor valuse must be > 0 and <= 1, otherwise the scaleFactor value is set to -1
  116. * and use default scaled to an image with an area of 160000 pixels.
  117. */
  118. - (void)setScaleFactor:(float)_scalingFactor NS_SWIFT_NAME(setScaleFactor(_scalingFactor:));
  119. //
  120. // float cv::wechat_qrcode::WeChatQRCode::getScaleFactor()
  121. //
  122. - (float)getScaleFactor NS_SWIFT_NAME(getScaleFactor());
  123. @end
  124. NS_ASSUME_NONNULL_END