zoukankan      html  css  js  c++  java
  • Arcface demo

    ```
     AFR_FSDKInterface engine = new AFR_FSDKEngine();
    
        //用来存放提取到的人脸信息, face_1 是注册的人脸,face_2 是要识别的人脸
        AFR_FSDKFace face1 = new AFR_FSDKFace();
        AFR_FSDKFace face2 = new AFR_FSDKFace();
    
        //初始化人脸识别引擎,使用时请替换申请的 APPID 和 SDKKEY
        AFR_FSDKError error = engine.AFR_FSDK_InitialEngine("APPID", "SDKKEY");
        Log.d("com.arcsoft", "AFR_FSDK_InitialEngine = " + error.getCode());
    
        //输入的 data 数据为 NV21 格式(如 Camera 里 NV21 格式的 preview 数据);人脸坐标一般使用人脸检测返回的 Rect 传入;人脸角度请按照人脸检测引擎返回的值传入。
        error = engine.AFR_FSDK_ExtractFRFeature(data1, width, height, AFR_FSDKEngine.CP_PAF_NV21, new Rect(210, 178, 478, 446), AFR_FSDKEngine.AFR_FOC_0, face1);
        Log.d("com.arcsoft", "Face=" + face1.getFeatureData()[0]+ "," + face1.getFeatureData()[1] + "," + face1.getFeatureData()[2] + "," + error.getCode());
    
        error = engine.AFR_FSDK_ExtractFRFeature(data1, width, height, AFR_FSDKEngine.CP_PAF_NV21, new Rect(210, 170, 470, 440), AFR_FSDKEngine.AFR_FOC_0, face2);
        Log.d("com.arcsoft", "Face=" + face2.getFeatureData()[0]+ "," + face2.getFeatureData()[1] + "," + face2.getFeatureData()[2] + "," + error.getCode());
    
        //score 用于存放人脸对比的相似度值
        AFR_FSDKMatching score = new AFR_FSDKMatching(); error = engine.AFR_FSDK_FacePairMatching(face1, face2, score); Log.d("com.arcsoft", "AFR_FSDK_FacePairMatching=" + error.getCode()); Log.d("com.arcsoft", "Score:" + score.getScore());
    
        //销毁人脸识别引擎
        error = engine.AFR_FSDK_UninitialEngine();
        Log.d("com.arcsoft", "AFR_FSDK_UninitialEngine : " + error.getCode());
    ```
  • 相关阅读:
    Linux下的”锁“事儿
    拿得起,放得下,想得开
    关于TCP协议握手的那些事儿

    C++中的RTTI机制解析
    C/C++中产生随机数
    数据库-事务和锁
    JS 数组Array常用方法
    C# 压缩 SharpZipLib
    正则表达式学习3-负向零宽断言
  • 原文地址:https://www.cnblogs.com/Zzz-/p/10882564.html
Copyright © 2011-2022 走看看