DFLivenessSDK Class Description
DFSilentLivenessDetector
DFSilentLivenessDetector is the instance for detect input image data.
Init
/**
* Init method
*
* @param strBundlePath bundle source path
* @param strLicensePath license path
*
* @return detector instance
*/
- (instancetype)initWithResourcesBundlePath:(NSString *)strBundlePath
licensePath:(NSString *)strLicensePath;
Parameter config
/**
* Setting parameters
*
* @param delegate delegate for callback
* @param queue queue for callback
*/
- (void)setDelegate:(id <DFSilentLivenessDetectorDelegate>)delegate
callBackQueue:(dispatch_queue_t)queue;
/**
Setting parameters
@param threshold threshold for detecting successfully
@param groupCount detecting group
*/
- (void)setThreshold:(float)threshold groupCount:(NSInteger)groupCount;
/**
Setting parameters
@param region face detected area in the screen
@param faceMaxSizeRatio Face size accounts for the size of the buffer picture
*/
- (void)setFaceDetectedRegion:(CGRect)region faceMaxSizeRatio:(float)faceMaxSizeRatio;
Detect
/**
* Continuous detection
*
* @param sampleBuffer sampleBuffer of camera
* @param faceOrientation face orientation
*/
- (void)trackAndDetectWithCMSampleBuffer:(CMSampleBufferRef)sampleBuffer
faceOrientation:(LivefaceOrientation)faceOrientation;
Start detection
/**
* Start detection
*/
- (void)startDetection;
Cancel detection
/**
* Cancel detection
*/
- (void)cancelDetection;
Version
/**
* Obtain the version of SDK
*
* @return SDK Version
*/
+ (NSString *)getSDKVersion;
DFSilentLivenessDetectorDelegate
Callback of detection
/**
* the callback of silent liveness detection
*/
@protocol DFSilentLivenessDetectorDelegate <NSObject>
@optional
Start detection
/**
* Start detection
*/
- (void)livenessDidStart;
Callback for each frame of image detection
/**
Callback for each frame of image detection
@param faceCount face count
@param faceRectStatus face status
*/
- (void)livenessDectectingFaceCount:(int)faceCount faceRectStatus:(LivefaceRectStatus)faceRectStatus;
@required
Silent liveness detect successfully
/**
* Success callback
*
* @param data encrypted data
* @param DFImage image data
* @param successScore last successful frame score(deprecated)
*/
- (void)livenessDidSuccessfulGetData:(NSData *)data
dfImages:(NSArray *)arrDFImage
successScore:(float)successScore;
Silent liveness detect failurely
/**
* Failure callback
*
* @param iErrorType error type
*/
- (void)livenessDidFailWithErrorType:(LivefaceErrorType)iErrorType;
Silent liveness detection cancel callback
/**
* Cancel detection callback
*/
- (void)livenessDidCancel;
LivefaceErrorType
Error type enumeration
type | description |
---|---|
LIVENESS_INIT_FAILD | Init error |
LIVENESS_CAMERA_ERROR | Camera authority error |
LIVENESS_WILL_RESIGN_ACTIVE | App enters background |
LIVENESS_INTERNAL_ERROR | Inner error |
LIVENESS_BUNDLEID_ERROR | BundleID error |
LIVENESS_AUTH_EXPIRE | License error |
LivefaceDetectionType
Detection type enumeration
type | description |
---|---|
LIVE_HOLDSTILL | Silent liveness detection |
LivefaceOrientation
Face direction enumeration
type | description |
---|---|
LIVE_FACE_UP | Up |
LIVE_FACE_LEFT | Left |
LIVE_FACE_DOWN | Down |
LIVE_FACE_RIGHT | Right |
LivefaceOutputType
Output type enumeration
type | description |
---|---|
LIVE_OUTPUT_MULTI_IMAGE | Multi image type |
LivefaceRectStatus
Face state enumeration
type | description |
---|---|
LivefaceRectStatusNone | None |
LivefaceRectStatusSuccess | Success |
LivefaceRectStatusLarge | Face size is large |