OliveappAsyncLivenessDetectorDelegate.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // AsyncLivenessDetectorDelegate.h
  3. // LivenessDetector
  4. //
  5. // Created by Xiaoyang Lin on 16/1/11.
  6. // Copyright © 2016年 Oliveapp. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "OliveappDetectedFrame.h"
  10. #import "OliveappFaceInfo.h"
  11. @protocol OliveappAsyncLivenessDetectorDelegate <NSObject>
  12. @required
  13. /**
  14. * 活体检测成功的回调
  15. *
  16. * @param detectedFrame 活体检测抓取的图片
  17. * @param faceInfo 捕获到的人脸信息
  18. */
  19. - (void) onLivenessSuccess: (OliveappDetectedFrame*) detectedFrame
  20. withFaceInfo:(OliveappFaceInfo*) faceInfo;
  21. /**
  22. * 活体检测失败的回调
  23. *
  24. * @param sessionState session状态,用于区别超时还是动作不过关
  25. * @param detectedFrame 活体检测抓取的图片
  26. */
  27. - (void) onLivenessFail: (int) sessionState
  28. withDetectedFrame: (OliveappDetectedFrame*) detectedFrame;
  29. /**
  30. 切换到下一个动作时的回调方法
  31. @param lastActionType 上一个动作类型
  32. @param lastActionResult 上一个动作的检测结果
  33. @param newActionType 当前新生成的动作类型
  34. @param currentActionIndex 当前是第几个动作
  35. @param faceInfo 人脸的信息
  36. */
  37. - (void) onActionChanged: (int)lastActionType
  38. withLastActionResult: (int)lastActionResult
  39. withNewActionType: (int)newActionType
  40. withCurrentActionIndex: (int)currentActionIndex
  41. withFaceInfo: (OliveappFaceInfo*) faceInfo;
  42. /**
  43. 每一帧结果的回调方法
  44. @param currentActionType 当前是什么动作
  45. @param actionState 当前动作的检测结果
  46. @param sessionState 整个Session是否通过
  47. @param faceInfo 检测到的人脸信息,可以用来做动画
  48. @param remainingTimeoutMilliSecond 剩余时间,以毫秒为单位
  49. @param errorCodeOfInAction 动作不过关的可能原因,可以用来做提示语
  50. */
  51. - (void) onFrameDetected: (int)currentActionType
  52. withActionState: (int)actionState
  53. withSessionState: (int)sessionState
  54. withFaceInfo:(OliveappFaceInfo*) faceInfo
  55. withRemainingTimeoutMilliSecond: (int)remainingTimeoutMilliSecond
  56. withErrorCodeOfInActionArray: (NSArray *) errorCodeOfInAction;
  57. @end