com.pax.dal
Interface ILivenessDetector
-
public interface ILivenessDetector
活体检测。The Liveness Detector.- Since:
- V3.19.00
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static interfaceILivenessDetector.IFaceUIManager自定义UI界面的服务。Custom UI interface services.static interfaceILivenessDetector.IPreviewFrame数据预览回调。Data preview callback.static interfaceILivenessDetector.LivenessDetectListener活体检测监听者。Liveness detect listener.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voiddetect(android.os.Bundle param, ILivenessDetector.LivenessDetectListener listener)进行活体检测。Start liveness detect.voiddetectLite(ILivenessDetector.LivenessDetectListener listener)进行无界面人脸活体检测,预览由客户自定义实现。The faceless live detection is performed, and the preview is customized by the customer.java.lang.StringgetCameraModel()获取银联认证的摄像头型号。Get UnionPay certified camera model.android.os.BundlegetConfig()获取活体检测配置信息。Get the liveness detection configuration information.voidinit()初始化活检相机。Initialize the liveness detection camera.voidinit(android.os.Bundle bundle)初始化活检相机。Initialize the liveness detection camera.voidrelease()释放活检相机。如果不调用该接口,其它应用会无法直接使用活检相机。 如果不存在直接调用活检相机的应用,可不调用此接口,这样可快速开启活检相机进行预览。Release the liveness detection camera.voidsetFaceUICallBack(ILivenessDetector.IFaceUIManager manager)使用自定义UI界面。接口在detect(Bundle, LivenessDetectListener)前调用。Use a custom UI interface.The interface is called beforedetect(Bundle, LivenessDetectListener).voidsetLiteUICallback(ILivenessDetector.IPreviewFrame callback)设置数据预览回调。Set data preview callback.voidstop()停止活体检测。 1.有界面活检时,该接口用于中断detect(Bundle, LivenessDetectListener),如果detect(Bundle, LivenessDetectListener)已结束则无需调用该接口。 2.客户自定义活检界面时,如果未调用detectLite(LivenessDetectListener),只是调用setFaceUICallBack(IFaceUIManager)进行预览,可用该接口停止预览。 如果setFaceUICallBack(IFaceUIManager)和detectLite(LivenessDetectListener)都调用了,可用该接口停止预览和活检。Stop liveness detect.
-
-
-
Method Detail
-
getConfig
android.os.Bundle getConfig() throws LivenessDetectException
获取活体检测配置信息。Get the liveness detection configuration information.- Returns:
Key 类型 说明 algorithmflag int 算法厂商标识码。 01:云从;02:奥比中光;03:华捷;04:百富。 algorithmver String 算法版本。 mode int 活检方式。01:3D;02:红外双目;03:TOF。 camerainfo String 摄像头信息。 cameramanu String 摄像头厂商。 cameramodel String 型号。 previewArea android.graphics.Rect 获取预览坐标,主要用于自定义faceUI时计算坐标位置。 cameraSize android.graphics.Rect 获取相机大小。 Key Type Instructions algorithmflag int Algorithm vendor identification code. 01:CloudWork;02:Orbbec;03:HuaJie;04:PAX. algorithmver String Algorithm version. mode int Detect way.01:3D;02:Infrared binocular;03:TOF. camerainfo String Camera information. cameramanu String Camera manufacturer. cameramodel String Camera model. previewArea android.graphics.Rect Get the preview coordinates, mainly used to calculate the coordinate position when customizing the faceUI. cameraSize android.graphics.Rect Get the camera size. - Throws:
LivenessDetectException- Since:
- V3.19.00
-
init
void init() throws LivenessDetectException
初始化活检相机。Initialize the liveness detection camera.- Throws:
LivenessDetectException- Since:
- V3.19.00
-
detect
void detect(android.os.Bundle param, ILivenessDetector.LivenessDetectListener listener) throws LivenessDetectException
进行活体检测。Start liveness detect.- Parameters:
param-活体检测配置。Key 类型 说明 timeout int 超时时间,毫秒。默认60000ms,最小15000ms。 matchscore double 评分阀值,0.0-1.0。默认0.5。 picnumber int 活检输出图片数量,默认1。 timeinterval int 毫秒,最低采样时间间隔,默认200毫秒。 amount String 消费金额,支持Html格式设置颜色,如" 240.5 "。detectArea android.graphics.Rect 检测区域坐标,使用自定义UI界面时需设置。 shouldPlayVoice boolean true:播放语言提示;false:不播放语言提示。默认播放。 checkQuality boolean true:进行质量检测;false:不质量检测。默认不开启质量检测。
如果开启会有以下提示:
1.离得太远: 请往前移一点
2.人脸有角度或者闭眼(大于30度): 请保持脸部端正
3.脸部有遮挡
4.请摘下口罩
5.请摘下墨镜
6.多人脸
7.活体检测失败 已废弃。如需使用,请在init(Bundle)使用。enableMultipleFaces boolean true:存在多人脸时,允许活检通过;false:存在多人脸时,不允许活检通过。默认true。 showFaceRect boolean true:绘制人脸框;false:不绘制人脸框。默认false。 Liveness detection configuration.Key Type Instructions timeout int Timeout in milliseconds.Default is 60000ms, minimum 15000ms. matchscore double Scoring threshold, 0.0-1.0.The default is 0.5. picnumber int The number of detection output images, default 1. timeinterval int Ms, minimum sampling interval, default 200 ms. amount String Amount spent. Supports HTML formatting for font colors such as " 240.5 ".detectArea android.graphics.Rect Detect area coordinates. it is required to set when using the custom UI interface. shouldPlayVoice boolean True: Play language prompt;False: Language prompts are not played.Play by default. checkQuality boolean True: check the quality; false: do not check the quality. Quality check is not performed by default.
If check the quality, the following prompts will appear:
1.It's too far: please move forward a little
2.Face with Angle or closed eyes (> 30 degrees): Keep face straight
3.The face is covered
4.Please take off the mask
5.Please take off the sunglasses
6.Multiple faces
7.Detection failed Obsolete. If you need to use it, please use it ininit(Bundle).enableMultipleFaces boolean True: Detection is allowed in the presence of multiple faces;False: Detection is not allowed in the presence of multiple faces.True by default. showFaceRect boolean True: Draw a real-time face rectangle.;False: Not draw a real-time face rectangle.False by default. listener-ILivenessDetector.LivenessDetectListener- Throws:
LivenessDetectException- Since:
- V3.19.00
-
stop
void stop() throws LivenessDetectException
停止活体检测。 1.有界面活检时,该接口用于中断detect(Bundle, LivenessDetectListener),如果detect(Bundle, LivenessDetectListener)已结束则无需调用该接口。 2.客户自定义活检界面时,如果未调用detectLite(LivenessDetectListener),只是调用setFaceUICallBack(IFaceUIManager)进行预览,可用该接口停止预览。 如果setFaceUICallBack(IFaceUIManager)和detectLite(LivenessDetectListener)都调用了,可用该接口停止预览和活检。Stop liveness detect. 1.When there is an interface biopsy, this interface is used to interruptdetect(Bundle, LivenessDetectListener), ifdetect(Bundle, LivenessDetectListener)has ended, there is no need to call this interface. 2.When the customer customizes the biopsy interface, ifdetectLite(LivenessDetectListener)is not called, butsetFaceUICallBack(IFaceUIManager)is only called to preview, this interface can be used to stop the preview. If bothsetFaceUICallBack(IFaceUIManager)anddetectLite(LivenessDetectListener)are called, this interface can be used to stop the preview and biopsy.- Throws:
LivenessDetectException- Since:
- V3.19.00
-
release
void release() throws LivenessDetectException
释放活检相机。如果不调用该接口,其它应用会无法直接使用活检相机。 如果不存在直接调用活检相机的应用,可不调用此接口,这样可快速开启活检相机进行预览。Release the liveness detection camera. Without this interface, other applications will not be able to use the liveness detection camera directly. If there is no application that calls the liveness detection camera directly, this interface may not be called, so that the liveness detection camera can be quickly turned on for preview.- Throws:
LivenessDetectException- Since:
- V3.19.00
-
setFaceUICallBack
void setFaceUICallBack(ILivenessDetector.IFaceUIManager manager) throws LivenessDetectException
使用自定义UI界面。接口在detect(Bundle, LivenessDetectListener)前调用。Use a custom UI interface.The interface is called beforedetect(Bundle, LivenessDetectListener).- Throws:
LivenessDetectException- Since:
- V3.19.00
-
init
void init(android.os.Bundle bundle) throws LivenessDetectException
初始化活检相机。Initialize the liveness detection camera.- Parameters:
bundle-活体检测配置。Key 类型 说明 checkQuality boolean true:进行质量检测;false:不质量检测。默认不开启质量检测。
如果开启会有以下提示:
1.离得太远: 请往前移一点
2.人脸有角度或者闭眼(大于30度): 请保持脸部端正
3.脸部有遮挡
4.请摘下口罩
5.请摘下墨镜
6.多人脸
7.假体: 个人检测失败Liveness detection configuration.Key Type Instructions checkQuality boolean True: check the quality; false: do not check the quality. Quality check is not performed by default.
If check the quality, the following prompts will appear:
1.It's too far: please move forward a little
2.Face with Angle or closed eyes (> 30 degrees): Keep face straight
3.The face is covered
4.Please take off the mask
5.Please take off the sunglasses
6.Multiple faces
7.Prosthesis: Detection failed- Throws:
LivenessDetectException- LivenessDetectException- Since:
- V3.24.00
-
getCameraModel
java.lang.String getCameraModel() throws LivenessDetectException
获取银联认证的摄像头型号。Get UnionPay certified camera model.- Returns:
- 摄像头型号。Camera model.
- Throws:
LivenessDetectException- LivenessDetectException- Since:
- V3.24.00
-
setLiteUICallback
void setLiteUICallback(ILivenessDetector.IPreviewFrame callback) throws LivenessDetectException
设置数据预览回调。Set data preview callback.- Parameters:
callback-数据预览回调。Data preview callback.- Throws:
LivenessDetectException- LivenessDetectException- Since:
- V3.24.00
-
detectLite
void detectLite(ILivenessDetector.LivenessDetectListener listener) throws LivenessDetectException
进行无界面人脸活体检测,预览由客户自定义实现。The faceless live detection is performed, and the preview is customized by the customer.- Parameters:
listener-ILivenessDetector.LivenessDetectListener- Throws:
LivenessDetectException- LivenessDetectException- Since:
- V3.24.00
-
-