SSFaceSDK.h
9.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
//
// IDLFaceSDK.h
// IDLFaceSDK
//
// Created by Tong,Shasha on 2017/5/15.
// Copyright © 2017年 Baidu. All rights reserved.
//
#import <UIKit/UIKit.h>
#define ATTR_VISIBILITY __attribute__((visibility("default")))
//
///**
// * 活体检测的类型
// */
typedef NS_ENUM(NSInteger, LivenessActionType) {
LivenessActionTypeLiveEye = 0,
LivenessActionTypeLiveMouth = 1,
LivenessActionTypeLiveYawRight = 2,
LivenessActionTypeLiveYawLeft = 3,
LivenessActionTypeLivePitchUp = 4,
LivenessActionTypeLivePitchDown = 5,
LivenessActionTypeNoAction = 6,
};
///**
// * 活体检测的返回状态
// */
typedef NS_ENUM(NSUInteger, LivenessRemindCode) {
LivenessRemindCodeOK = 0, //成功
LivenessRemindCodeBeyondPreviewFrame, //出框
LivenessRemindCodeNoFaceDetected, //没有检测到人脸
LivenessRemindCodeMuchIllumination,
LivenessRemindCodePoorIllumination, //光照不足
LivenessRemindCodeImageBlured, //图像模糊
LivenessRemindCodeTooFar, //太远
LivenessRemindCodeTooClose, //太近
LivenessRemindCodePitchOutofDownRange, //头部偏低
LivenessRemindCodePitchOutofUpRange, //头部偏高
LivenessRemindCodeYawOutofLeftRange, //头部偏左
LivenessRemindCodeYawOutofRightRange, //头部偏右
LivenessRemindCodeOcclusionLeftEye, //左眼有遮挡
LivenessRemindCodeOcclusionRightEye, //右眼有遮挡
LivenessRemindCodeOcclusionNose, //鼻子有遮挡
LivenessRemindCodeOcclusionMouth, //嘴巴有遮挡
LivenessRemindCodeOcclusionLeftContour, //左脸颊有遮挡
LivenessRemindCodeOcclusionRightContour, //右脸颊有遮挡
LivenessRemindCodeOcclusionChinCoutour, //下颚有遮挡
// LivenessRemindCodeOcclusioneyebrow, //眉毛有遮挡
LivenessRemindCodeTimeout, //超时
LivenessRemindCodeLiveEye, //眨眨眼
LivenessRemindCodeLiveMouth, //张大嘴
LivenessRemindCodeLiveYawLeft, //向右摇头
LivenessRemindCodeLiveYawRight, //向左摇头
LivenessRemindCodeLivePitchUp, //向上抬头
LivenessRemindCodeLivePitchDown, //向下低头
LivenessRemindCodeLiveYaw, //摇摇头
LivenessRemindCodeSingleLivenessFinished, //完成一个活体动作
LivenessRemindActionCodeTimeout, // 当前活体动作超时
LivenessRemindCodeLeftEyeClosed, //左眼关闭
LivenessRemindCodeRightEyeClosed,
LivenessRemindCodeVerifyInitError, //鉴权失败
LivenessRemindCodeFaceIdChanged, // faceid 发生变化
LivenessRemindCodeSilentNoPass //静默活体分数未通过
};
///**
// * 人脸探测的返回状态
// */
typedef NS_ENUM(NSUInteger, DetectRemindCode) {
DetectRemindCodeOK = 0, //成功
DetectRemindCodeBeyondPreviewFrame, //出框
DetectRemindCodeNoFaceDetected, //没有检测到人脸
DetectRemindCodeMuchIllumination,
DetectRemindCodePoorIllumination, //光照不足
DetectRemindCodeImageBlured, //图像模糊
DetectRemindCodeTooFar, //太远
DetectRemindCodeTooClose, //太近
DetectRemindCodePitchOutofDownRange, //头部偏低
DetectRemindCodePitchOutofUpRange, //头部偏高
DetectRemindCodeYawOutofLeftRange, //头部偏左
DetectRemindCodeYawOutofRightRange, //头部偏右
DetectRemindCodeOcclusionLeftEye, //左眼有遮挡
DetectRemindCodeOcclusionRightEye, //右眼有遮挡
DetectRemindCodeOcclusionNose, //鼻子有遮挡
DetectRemindCodeOcclusionMouth, //嘴巴有遮挡
DetectRemindCodeOcclusionLeftContour, //左脸颊有遮挡
DetectRemindCodeOcclusionRightContour, //右脸颊有遮挡
DetectRemindCodeOcclusionChinCoutour, //下颚有遮挡
DetectRemindCodeTimeout, //超时
DetectRemindCodeVerifyInitError, //鉴权失败
DetectRemindCodeSilentNoPass //静默活体分数未通过
};
//
//
///**
// * 人脸探测的跟踪状态
// */
typedef NS_ENUM(NSUInteger, TrackDetectRemindCode) {
TrackDetectRemindCodeOK = 0, //成功
TrackDetectRemindCodeImageBlured, //图像模糊
TrackDetectRemindCodePoorIllumination, // 光照不足
TrackDetectRemindCodeNoFaceDetected, //没有检测到人脸
TrackDetectRemindCodeOcclusionLeftEye, //左眼有遮挡
TrackDetectRemindCodeOcclusionRightEye, //右眼有遮挡
TrackDetectRemindCodeOcclusionNose, //鼻子有遮挡
TrackDetectRemindCodeOcclusionMouth, //嘴巴有遮挡
TrackDetectRemindCodeOcclusionLeftContour, //左脸颊有遮挡
TrackDetectRemindCodeOcclusionRightContour, //右脸颊有遮挡
TrackDetectRemindCodeOcclusionChinCoutour, //下颚有遮挡
TrackDetectRemindCodeTooClose, //太近
TrackDetectRemindCodeTooFar, //太远
TrackDetectRemindCodeBeyondPreviewFrame //出框
};
typedef NS_ENUM(NSUInteger, ColorRemindCode) {
ColorRemindCodeOK = 0, //成功
ColorRemindCodeBeyondPreviewFrame, //出框
ColorRemindCodeNoFaceDetected, //没有检测到人脸
ColorRemindCodeMuchIllumination,
ColorRemindCodePoorIllumination, //光照不足
ColorRemindCodeImageBlured, //图像模糊
ColorRemindCodeTooFar, //太远
ColorRemindCodeTooClose, //太近
ColorRemindCodePitchOutofDownRange, //头部偏低
ColorRemindCodePitchOutofUpRange, //头部偏高
ColorRemindCodeYawOutofLeftRange, //头部偏左
ColorRemindCodeYawOutofRightRange, //头部偏右
ColorRemindCodeOcclusionLeftEye, //左眼有遮挡
ColorRemindCodeOcclusionRightEye, //右眼有遮挡
ColorRemindCodeOcclusionNose, //鼻子有遮挡
ColorRemindCodeOcclusionMouth, //嘴巴有遮挡
ColorRemindCodeOcclusionLeftContour, //左脸颊有遮挡
ColorRemindCodeOcclusionRightContour, //右脸颊有遮挡
ColorRemindCodeOcclusionChinCoutour, //下颚有遮挡
// ColorRemindCodeOcclusioneyebrow, //眉毛有遮挡
ColorRemindCodeTimeout, //超时
ColorRemindCodeVerifyInitError, //鉴权失败
ColorRemindCodeSuccess, //炫彩活体采集成功
ColorRemindCodeColorMatchFailed, //炫彩活体采集失败颜色匹配失败
ColorRemindCodeScoreFailed, //炫彩活体采集失败分数过低
ColorRemindCodeBreak, //炫彩中途失败,由于当前颜色没有拿到质量满足的图片
ColorRemindCodeComplete, //炫彩活体完成
ColorRemindCodeChangeColor,//炫彩颜色变换
ColorRemindCodeFaceIdChanged // faceid 发生变化
};
/**
* 证件类型
*/
typedef NSString *FaceIdCardType NS_STRING_ENUM;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceIdCardType const KFaceIdCardTypeDefault; // 默认 大陆身份证
FOUNDATION_EXPORT ATTR_VISIBILITY FaceIdCardType const KFaceIdCardTypeMTPIDCard; // 港澳居民来往内地通行证
FOUNDATION_EXPORT ATTR_VISIBILITY FaceIdCardType const KFaceIdCardTypeFPRIDCard; // 外国人永久居留身份证
FOUNDATION_EXPORT ATTR_VISIBILITY FaceIdCardType const KFaceIdCardTypePassport; // 定居国外的中国公民护照
/**
* 活体控制
*/
typedef NSString *FaceLivenessControlType NS_STRING_ENUM;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceLivenessControlType const FaceLivenessControlTypeNone;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceLivenessControlType const FaceLivenessControlTypeLow;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceLivenessControlType const FaceLivenessControlTypeNormal;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceLivenessControlType const FaceLivenessControlTypeHeight;
/**
* 合成图控制
*/
typedef NSString *FaceSpoofingControlType NS_STRING_ENUM;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceSpoofingControlType const FaceSpoofingControlTypeNone;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceSpoofingControlType const FaceSpoofingControlTypeLow;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceSpoofingControlType const FaceSpoofingControlTypeNormal;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceSpoofingControlType const FaceSpoofingControlTypeHeight;
/**
* 质量控制
*/
typedef NSString *FaceQualityControlType NS_STRING_ENUM;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceQualityControlType const FaceQualityControlTypeNone;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceQualityControlType const FaceQualityControlTypeLow;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceQualityControlType const FaceQualityControlTypeNormal;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceQualityControlType const FaceQualityControlTypeHeight;
/**
* 上传图片信息类型
*/
typedef NSString *FaceRegisterImageType NS_STRING_ENUM;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceRegisterImageType const FaceRegisterImageTypeBase64;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceRegisterImageType const FaceRegisterImageTypeURL;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceRegisterImageType const FaceRegisterImageTypeFaceToken;
/**
* 人脸图片类型
*/
typedef NSString *FaceFaceType NS_STRING_ENUM;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceFaceType const FaceFaceTypeLive;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceFaceType const FaceFaceTypeIDCard;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceFaceType const FaceFaceTypeWaterMark;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceFaceType const FaceFaceTypeCert;
FOUNDATION_EXPORT ATTR_VISIBILITY FaceFaceType const FaceFaceTypeInfred;
/**
* 人脸检测排序类型
*/
typedef NS_ENUM(NSInteger, FaceSortype) {
FaceSortypeAreaFromBigToSmall = 0,
FaceSortypeDistanceNearToFar = 1
};
/**
* 人脸采集结果参与业务流程
*/
typedef NS_ENUM(NSInteger, BDFaceResultReportType) {
BDFaceResultReportTypeVerifySec = 1, // 实名认证
BDFaceResultReportTypeMatchSec = 2, // 人脸对比
};
/**
* 人脸校验流程
*/
typedef NS_ENUM(NSInteger, SSFaceProcessType) {
SSFaceProcessTypeSilenceLiveness = 1,
SSFaceProcessTypeActionLiveness = 2,
SSFaceProcessTypeColorLiveness = 3,
SSFaceProcessTypeVideoRecording = 4,
};
/**
* 返回图片类型
*/
typedef NS_ENUM(NSInteger, SSFaceProcessImageType) {
SSFaceProcessImageTypeCrop = 1,
SSFaceProcessImageTypeOrigin = 2
};
#import "FaceSDKManager.h"
#import "SSFaceProcessManager.h"