OliveappStructLivenessFrameResult.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // StructLivenessFrameResult.h
  3. // LivenessDetector
  4. //
  5. // Created by Xiaoyang Lin on 16/1/7.
  6. // Copyright © 2016年 Oliveapp. All rights reserved.
  7. //
  8. #ifndef StructLivenessFrameResult_h
  9. #define StructLivenessFrameResult_h
  10. /*
  11. * 活体检测会话状态
  12. */
  13. enum EnumLivenessSessionResult
  14. {
  15. SESSION_NOT_START = 0, // 活体检测未开始
  16. SESSION_NOT_SURE = 1, // 不确定 是否结束
  17. SESSION_PASS = 2, // 活体检测通过
  18. SESSION_FAIL = 3, // 活体检测失败
  19. SESSION_TIMEOUT = 4 // 活体检测超时
  20. };
  21. enum EnumFacialActionType
  22. {
  23. FACIAL_ACTION_UNKOWN = 0, //不支持
  24. FACIAL_ACTION_MOUTH_OPEN = 1,//支持
  25. FACIAL_ACTION_EYE_CLOSE = 3,//支持
  26. FACIAL_ACTION_CAPTURE = 50,//支持
  27. FACIAL_ACTION_HEAD_LEFT = 51,//不支持
  28. FACIAL_ACTION_HEAD_RIGHT = 52,//不支持
  29. FACIAL_ACTION_HEAD_UP = 53,//支持
  30. FACIAL_ACTION_HEAD_DOWN = 54,//不支持
  31. FACIAL_ACTION_HEAD_SHAKE_SIDE_TO_SIDE = 60//支持
  32. };
  33. enum StructFacialActionVerificationResultType
  34. {
  35. START = 0, /// waiting user to focus on screen
  36. PASS = 1000, /// genuine & finished the facial action
  37. FAIL = 1001, /// the facial action is not finished
  38. NOT_SURE = 1002 /// Not sure
  39. };
  40. enum EnumErrorCodeOfInAction
  41. {
  42. NONE = 0,
  43. FACE_NOT_FOUND = 10,
  44. FACE_TOO_SMALL_FACE,
  45. FACE_TOO_LARGE_FACE,
  46. LIGHT_TOO_BRIGHT = 20,
  47. LIGHT_TOO_DARK,
  48. FACE_SIDE_FACE = 30,
  49. FACE_UP_FACE,
  50. FACE_DOWN_FACE
  51. };
  52. struct StructFacialActionVerificationResult
  53. {
  54. enum StructFacialActionVerificationResultType state;
  55. double normalizedConfidence; // verify score(normalized score), should be in range [0, 100]
  56. };
  57. struct Position
  58. {
  59. double x;
  60. double y;
  61. };
  62. // 单帧活体检测结果
  63. struct StructLivenessFrameResult
  64. {
  65. // 错误码
  66. int rtn;
  67. // Session级的信息
  68. enum EnumLivenessSessionResult sessionState; // 活体检测结果
  69. bool isActionChanged; // 动作是否切换
  70. // 动作级的信息
  71. int currentActionIndex;
  72. enum EnumFacialActionType actionTypes[10]; // 当前动作是什么,上限是10个,可以根据需要调整
  73. struct StructFacialActionVerificationResult actionResults[10]; // 动作的状态,上限是10个,可以根据需要调整
  74. int remainTimeoutMilliSecond; // 剩余的超时时间
  75. enum EnumErrorCodeOfInAction errorCodeOfInAction[10]; //动作反馈
  76. struct Position leftEye;//左眼坐标
  77. struct Position rightEye;//右眼坐标
  78. struct Position mouth;
  79. struct Position chin;
  80. };
  81. #endif /* StructLivenessFrameResult_h */