MGLiveErrorManager.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // MGFaceError.h
  3. // MGFaceDetection
  4. //
  5. // Created by megvii on 15/12/23.
  6. // Copyright © 2015Year megvii. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "LivenessDetector.h"
  10. #import "MGFaceQualityManager.h"
  11. /**
  12. * 照镜子成功返回的key
  13. */
  14. static NSString *const MGFaceFinishKey = @"com.megvii.face.finish";
  15. /**
  16. * 错误提示管理器,只在照镜子阶段调用,正式进入活体动作后,不再调用
  17. */
  18. @interface MGLiveErrorManager : NSObject
  19. /**
  20. * 检测每一帧的错误 manager
  21. */
  22. @property (nonatomic, strong, readonly) MGFaceQualityManager *qualityManager;
  23. /**
  24. * 抛出出错最多的错误, 防止连续显示错误,造成显示异常,默认 10 帧。
  25. */
  26. @property (nonatomic, assign) NSInteger holdingErrorCount;
  27. /**
  28. * 请使用 initWithFaceCenter: 方法进行初始化!
  29. */
  30. - (instancetype)init DEPRECATED_ATTRIBUTE;
  31. /**
  32. * 请使用该方法初始化
  33. * @param center 人脸中心位置 类似于 (0.5,0.5)之类相对值
  34. * @return 实例化对象
  35. */
  36. - (instancetype)initWithFaceCenter:(CGPoint)center;
  37. /**
  38. * 检测每一帧错误,并且返回要处理的事情
  39. *
  40. * @param frame 活体的每一帧结果
  41. * @param motionY 当前的 重力的 y轴值 如果忽略该判断,请设置该值为 1.0
  42. *
  43. * @return 返回结果 (MGFaceFinishKey 为检测成功,可以进入活体动作)
  44. */
  45. - (NSString *)checkImgWithMGFrame:(MGLivenessDetectionFrame *)frame motionY:(CGFloat)motionY;
  46. /**
  47. * 重置失败列表
  48. */
  49. - (void)resetErrorList;
  50. @end