com.pax.dal

Interface ILivenessDetector



  • public interface ILivenessDetector
    活体检测。
    The Liveness Detector.
    Since:
    V3.19.00
    • 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
      • 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格式设置颜色,如"<font color='#ff0000'>240.5</font>"。
        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 "<font color='#ff0000'>240.5</font>".
        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 in init(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
      • 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
      • 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