FaceRecognizerSF.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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/face.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. @class Mat;
  14. // C++: enum DisType (cv.FaceRecognizerSF.DisType)
  15. typedef NS_ENUM(int, DisType) {
  16. FR_COSINE = 0,
  17. FR_NORM_L2 = 1
  18. };
  19. NS_ASSUME_NONNULL_BEGIN
  20. // C++: class FaceRecognizerSF
  21. /**
  22. * DNN-based face recognizer
  23. *
  24. * model download link: https://github.com/opencv/opencv_zoo/tree/master/models/face_recognition_sface
  25. *
  26. * Member of `Objdetect`
  27. */
  28. CV_EXPORTS @interface FaceRecognizerSF : NSObject
  29. #ifdef __cplusplus
  30. @property(readonly)cv::Ptr<cv::FaceRecognizerSF> nativePtr;
  31. #endif
  32. #ifdef __cplusplus
  33. - (instancetype)initWithNativePtr:(cv::Ptr<cv::FaceRecognizerSF>)nativePtr;
  34. + (instancetype)fromNative:(cv::Ptr<cv::FaceRecognizerSF>)nativePtr;
  35. #endif
  36. #pragma mark - Methods
  37. //
  38. // void cv::FaceRecognizerSF::alignCrop(Mat src_img, Mat face_box, Mat& aligned_img)
  39. //
  40. /**
  41. * Aligning image to put face on the standard position
  42. * @param src_img input image
  43. * @param face_box the detection result used for indicate face in input image
  44. * @param aligned_img output aligned image
  45. */
  46. - (void)alignCrop:(Mat*)src_img face_box:(Mat*)face_box aligned_img:(Mat*)aligned_img NS_SWIFT_NAME(alignCrop(src_img:face_box:aligned_img:));
  47. //
  48. // void cv::FaceRecognizerSF::feature(Mat aligned_img, Mat& face_feature)
  49. //
  50. /**
  51. * Extracting face feature from aligned image
  52. * @param aligned_img input aligned image
  53. * @param face_feature output face feature
  54. */
  55. - (void)feature:(Mat*)aligned_img face_feature:(Mat*)face_feature NS_SWIFT_NAME(feature(aligned_img:face_feature:));
  56. //
  57. // double cv::FaceRecognizerSF::match(Mat face_feature1, Mat face_feature2, int dis_type = FaceRecognizerSF::FR_COSINE)
  58. //
  59. /**
  60. * Calculating the distance between two face features
  61. * @param face_feature1 the first input feature
  62. * @param face_feature2 the second input feature of the same size and the same type as face_feature1
  63. * @param dis_type defining the similarity with optional values "FR_OSINE" or "FR_NORM_L2"
  64. */
  65. - (double)match:(Mat*)face_feature1 face_feature2:(Mat*)face_feature2 dis_type:(int)dis_type NS_SWIFT_NAME(match(face_feature1:face_feature2:dis_type:));
  66. /**
  67. * Calculating the distance between two face features
  68. * @param face_feature1 the first input feature
  69. * @param face_feature2 the second input feature of the same size and the same type as face_feature1
  70. */
  71. - (double)match:(Mat*)face_feature1 face_feature2:(Mat*)face_feature2 NS_SWIFT_NAME(match(face_feature1:face_feature2:));
  72. //
  73. // static Ptr_FaceRecognizerSF cv::FaceRecognizerSF::create(String model, String config, int backend_id = 0, int target_id = 0)
  74. //
  75. /**
  76. * Creates an instance of this class with given parameters
  77. * @param model the path of the onnx model used for face recognition
  78. * @param config the path to the config file for compability, which is not requested for ONNX models
  79. * @param backend_id the id of backend
  80. * @param target_id the id of target device
  81. */
  82. + (FaceRecognizerSF*)create:(NSString*)model config:(NSString*)config backend_id:(int)backend_id target_id:(int)target_id NS_SWIFT_NAME(create(model:config:backend_id:target_id:));
  83. /**
  84. * Creates an instance of this class with given parameters
  85. * @param model the path of the onnx model used for face recognition
  86. * @param config the path to the config file for compability, which is not requested for ONNX models
  87. * @param backend_id the id of backend
  88. */
  89. + (FaceRecognizerSF*)create:(NSString*)model config:(NSString*)config backend_id:(int)backend_id NS_SWIFT_NAME(create(model:config:backend_id:));
  90. /**
  91. * Creates an instance of this class with given parameters
  92. * @param model the path of the onnx model used for face recognition
  93. * @param config the path to the config file for compability, which is not requested for ONNX models
  94. */
  95. + (FaceRecognizerSF*)create:(NSString*)model config:(NSString*)config NS_SWIFT_NAME(create(model:config:));
  96. @end
  97. NS_ASSUME_NONNULL_END