BarcodeDetector.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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/objdetect.hpp"
  8. #import "opencv2/objdetect/barcode.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. #import "GraphicalCodeDetector.h"
  14. @class Mat;
  15. NS_ASSUME_NONNULL_BEGIN
  16. // C++: class BarcodeDetector
  17. /**
  18. * The BarcodeDetector module
  19. *
  20. * Member of `Objdetect`
  21. */
  22. CV_EXPORTS @interface BarcodeDetector : GraphicalCodeDetector
  23. #ifdef __cplusplus
  24. @property(readonly)cv::Ptr<cv::barcode::BarcodeDetector> nativePtrBarcodeDetector;
  25. #endif
  26. #ifdef __cplusplus
  27. - (instancetype)initWithNativePtr:(cv::Ptr<cv::barcode::BarcodeDetector>)nativePtr;
  28. + (instancetype)fromNative:(cv::Ptr<cv::barcode::BarcodeDetector>)nativePtr;
  29. #endif
  30. #pragma mark - Methods
  31. //
  32. // cv::barcode::BarcodeDetector::BarcodeDetector()
  33. //
  34. /**
  35. * Initialize the BarcodeDetector.
  36. */
  37. - (instancetype)init;
  38. //
  39. // cv::barcode::BarcodeDetector::BarcodeDetector(string prototxt_path, string model_path)
  40. //
  41. /**
  42. * Initialize the BarcodeDetector.
  43. *
  44. * Parameters allow to load _optional_ Super Resolution DNN model for better quality.
  45. * @param prototxt_path prototxt file path for the super resolution model
  46. * @param model_path model file path for the super resolution model
  47. */
  48. - (instancetype)initWithPrototxt_path:(NSString*)prototxt_path model_path:(NSString*)model_path;
  49. //
  50. // bool cv::barcode::BarcodeDetector::decodeWithType(Mat img, Mat points, vector_string& decoded_info, vector_string& decoded_type)
  51. //
  52. /**
  53. * Decodes barcode in image once it's found by the detect() method.
  54. *
  55. * @param img grayscale or color (BGR) image containing bar code.
  56. * @param points vector of rotated rectangle vertices found by detect() method (or some other algorithm).
  57. * For N detected barcodes, the dimensions of this array should be [N][4].
  58. * Order of four points in vector<Point2f> is bottomLeft, topLeft, topRight, bottomRight.
  59. * @param decoded_info UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
  60. * @param decoded_type vector strings, specifies the type of these barcodes
  61. * @return true if at least one valid barcode have been found
  62. */
  63. - (BOOL)decodeWithType:(Mat*)img points:(Mat*)points decoded_info:(NSMutableArray<NSString*>*)decoded_info decoded_type:(NSMutableArray<NSString*>*)decoded_type NS_SWIFT_NAME(decodeWithType(img:points:decoded_info:decoded_type:));
  64. //
  65. // bool cv::barcode::BarcodeDetector::detectAndDecodeWithType(Mat img, vector_string& decoded_info, vector_string& decoded_type, Mat& points = Mat())
  66. //
  67. /**
  68. * Both detects and decodes barcode
  69. *
  70. * @param img grayscale or color (BGR) image containing barcode.
  71. * @param decoded_info UTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded.
  72. * @param decoded_type vector of strings, specifies the type of these barcodes
  73. * @param points optional output vector of vertices of the found barcode rectangle. Will be empty if not found.
  74. * @return true if at least one valid barcode have been found
  75. */
  76. - (BOOL)detectAndDecodeWithType:(Mat*)img decoded_info:(NSMutableArray<NSString*>*)decoded_info decoded_type:(NSMutableArray<NSString*>*)decoded_type points:(Mat*)points NS_SWIFT_NAME(detectAndDecodeWithType(img:decoded_info:decoded_type:points:));
  77. /**
  78. * Both detects and decodes barcode
  79. *
  80. * @param img grayscale or color (BGR) image containing barcode.
  81. * @param decoded_info UTF8-encoded output vector of string(s) or empty vector of string if the codes cannot be decoded.
  82. * @param decoded_type vector of strings, specifies the type of these barcodes
  83. * @return true if at least one valid barcode have been found
  84. */
  85. - (BOOL)detectAndDecodeWithType:(Mat*)img decoded_info:(NSMutableArray<NSString*>*)decoded_info decoded_type:(NSMutableArray<NSString*>*)decoded_type NS_SWIFT_NAME(detectAndDecodeWithType(img:decoded_info:decoded_type:));
  86. @end
  87. NS_ASSUME_NONNULL_END