Ejemplo n.º 1
0
        /// <summary>
        /// 进行人脸检测。返回检测结果代码。如果返回值为DETECT_CODE_OK 可调用 getTrackedFaces 获取人脸相关信息。
        /// </summary>
        /// <param name="argb">   人脸argb_8888图片。 </param>
        /// <param name="width">  图片宽度 </param>
        /// <param name="height"> 图片高度 </param>
        /// <returns> 检测结果代码。 </returns>
        public virtual int detect(int[] argb, int width, int height)
        {
            if (initStatus != FaceSDKManager.SDK_INITED)
            {
                return(UNKNOW_TYPE);
            }
            int minDetectFace = FaceEnvironment.getMiniFaceSize();

            if (width < minDetectFace || height < minDetectFace)
            {
                return(NO_FACE_DETECTED);
            }
            return(this.mFaceTracker.Prepare_max_face_data_for_verify(argb, height, width, FaceSDK.ImgType.Argb.Ordinal(), FaceTracker.ActionType.Recognize.Ordinal()));
        }
Ejemplo n.º 2
0
        public void init(Context context, FaceEnvironment environment)
        {
            this.context         = context;
            this.faceEnvironment = environment;

            if (mFaceTracker == null)
            {
                mFaceTracker = new FaceTracker(context);
                mFaceTracker.Set_isFineAlign(false);
                mFaceTracker.Set_isVerifyLive(false);
                mFaceTracker.Set_isCheckQuality(environment.isCheckQuality());
                mFaceTracker.Set_DetectMethodType(1);
                mFaceTracker.Set_isCheckQuality(environment.isCheckQuality());
                mFaceTracker.Set_notFace_thr(environment.getNotFaceThreshold());
                mFaceTracker.Set_min_face_size(environment.getMiniFaceSize());
                mFaceTracker.Set_cropFaceSize(FaceEnvironment.VALUE_CROP_FACE_SIZE);
                mFaceTracker.Set_illum_thr(environment.getIlluminationThreshold());
                mFaceTracker.Set_blur_thr(environment.getBlurrinessThreshold());
                mFaceTracker.Set_occlu_thr(environment.getOcclulationThreshold());
                mFaceTracker.Set_max_reg_img_num(FaceEnvironment.VALUE_MAX_CROP_IMAGE_NUM);
                mFaceTracker.Set_eulur_angle_thr(environment.getPitch(), environment.getYaw(), environment.getRoll());
                // mFaceTracker.set_track_by_detection_interval(50);
            }
        }