Пример #1
0
        /// <summary>
        /// 人脸比对SDK初始化
        /// </summary>
        /// <param name="strPath"></param>
        /// <param name="nReserve"></param>
        /// <returns></returns>
        public int FaceVerifyInit(string strPath, int nReserve)
        {
            if (mVerifyHandler != IntPtr.Zero)
            {
                return(RTN_SUCC);
            }

            string strConfigPath = strPath + "\\config\\config.json";

            byte[] Buffer = Encoding.Default.GetBytes(strConfigPath);
            if (Buffer.Length > 260 - 2)
            {
                return(RET_NOT_SUPPORTED);
            }

            int rtn = RET_EXCEPTION;

            FACE_VERIFY_INIT_PARAM fsParam = new FACE_VERIFY_INIT_PARAM();

            fsParam.configPath = new byte[260];


            int i;

            for (i = 0; i < Buffer.Length; i++)
            {
                fsParam.configPath[i] = Buffer[i];
            }

            fsParam.configPath[i + 1] = 0;
            fsParam.configPath[i + 2] = 0;

            rtn = FaceVerify_Init(ref fsParam, ref mVerifyHandler);
            if (rtn <= -11101 && rtn >= -11105)
            {//license error
                return(RTN_LICENSE_ERROR);
            }
            return(rtn);
        }
Пример #2
0
 private extern static int FaceVerify_Init(ref FACE_VERIFY_INIT_PARAM pInitParam, ref IntPtr pHandle);