• 大小: 35.77MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-07
  • 语言: C#
  • 标签: 人脸识别  ArcFace  2.1  

资源简介

增加保存人脸到mssql数据库的方法和从数据库读取人脸的方法。本程序不含数据库文件,需要自己新建数据库。使用前先申请虹软开发者,免费申请得到APP_ID 和key等。从虹软下载的C#sdk 2.1的dll覆盖bin/Debug目录下对应的dll。在App.config填写自己的APP_ID 和key即可正常使用,此ArcFace 2.0为本地调用,非网络接口调用。调用无限制。开发工具vs2013,net4.5.1 上次写错版本,应该是ArcFace 2.1。请勿下载错sdk版本

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using ArcSoftFace.SDKModels;
using ArcSoftFace.SDKUtil;
using ArcSoftFace.Utils;
using ArcSoftFace.Entity;
using System.IO;
using System.Configuration;
using System.Threading;
using AForge.Video.DirectShow;
using System.Text.Regularexpressions;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.Data;
using System.Data.SqlClient;
namespace ArcSoftFace
{
    public partial class FaceForm : Form
    {
        //引擎Handle
        private IntPtr pImageEngine = IntPtr.Zero;

        //保存右侧图片路径
        private string image1Path;

        //右侧图片人脸特征
        private IntPtr image1Feature;

        //保存对比图片的列表
        private List imagePathList = new List();

        //左侧图库人脸特征列表
        private List imagesFeatureList = new List();

        //相似度
        private float threshold = 0.8f;

        //用于标记是否需要清除比对结果
        private bool isCompare = false;

        private IntPtr pcs;

        #region 视频模式下相关

        //视频引擎Handle
        private IntPtr pVideoEngine = IntPtr.Zero;

        //视频引擎 FR Handle 处理   FR和图片引擎分开,减少强占引擎的问题
        private IntPtr pVideoImageEngine = IntPtr.Zero;
        /// 
        /// 视频输入设备信息
        /// 

        private FilterInfoCollection filterInfoCollection;
        private VideoCaptureDevice deviceVideo;

        //从数据库读取人脸库数据存在list   2019.5.21加上
        private List faceDb = new List();
        #endregion

        public FaceForm()
        {
            InitializeComponent();
            InitEngines();
            videoSource.Hide();
            txtThreshold.Enabled = false;
            CheckForIllegalCrossThreadCalls = false;
        }

        /// 
        /// 初始化引擎
        /// 

        private void InitEngines()
        {
            //读取配置文件
            AppSettingsReader reader = new AppSettingsReader();
            string appId = (string)reader.GetValue(“APP_ID“ typeof(string));
            string sdkKey64 = (string)reader.GetValue(“SDKKEY64“ typeof(string));
            string sdkKey32 = (string)reader.GetValue(“SDKKEY32“ typeof(string));

            var is64CPU = Environment.Is64BitProcess;
            if (is64CPU)
            {
                if (string.IsNullOrWhiteSpace(appId) || string.IsNullOrWhiteSpace(sdkKey64))
                {
                    chooseMultiImgBtn.Enabled = false;
                    matchBtn.Enabled = false;
                    btnClearFaceList.Enabled = false;
                    chooseImgBtn.Enabled = false;
                    MessageBox.Show(“请在App.config配置文件中先配置APP_ID和SDKKEY64!“);
                    return;
                }
            }
            else
            {
                if (string.IsNullOrWhiteSpace(appId) 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      57856  2019-03-25 03:30  ArcSoftFace\.vs\ArcSoftFace\v14\.suo

     文件        767  2019-05-21 17:26  ArcSoftFace\ArcSoftFace\App.config

     文件       8656  2019-05-21 17:21  ArcSoftFace\ArcSoftFace\ArcSoftFace.csproj

     文件      44544  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\bin\Debug\AForge.Controls.dll

     文件      17920  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\bin\Debug\AForge.dll

     文件     262656  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\bin\Debug\AForge.Imaging.dll

     文件      16384  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\bin\Debug\AForge.Imaging.Formats.dll

     文件      68096  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\bin\Debug\AForge.Math.dll

     文件      61440  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\bin\Debug\AForge.Video.DirectShow.dll

     文件      20992  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\bin\Debug\AForge.Video.dll

     文件      99328  2019-05-21 17:26  ArcSoftFace\ArcSoftFace\bin\Debug\ArcSoftFace.exe

     文件        767  2019-05-21 17:26  ArcSoftFace\ArcSoftFace\bin\Debug\ArcSoftFace.exe.config

     文件      73216  2019-05-21 17:26  ArcSoftFace\ArcSoftFace\bin\Debug\ArcSoftFace.pdb

     文件      24224  2019-05-21 17:26  ArcSoftFace\ArcSoftFace\bin\Debug\ArcSoftFace.vshost.exe

     文件        767  2019-05-21 17:26  ArcSoftFace\ArcSoftFace\bin\Debug\ArcSoftFace.vshost.exe.config

     文件        490  2016-03-09 13:48  ArcSoftFace\ArcSoftFace\bin\Debug\ArcSoftFace.vshost.exe.manifest

     文件        610  2019-05-10 17:29  ArcSoftFace\ArcSoftFace\bin\Debug\asf_install.dat

     文件      53760  2019-05-10 17:20  ArcSoftFace\ArcSoftFace\bin\Debug\AxInterop.WMPLib.dll

     文件     331264  2019-05-10 17:20  ArcSoftFace\ArcSoftFace\bin\Debug\Interop.WMPLib.dll

     文件   44789760  2019-05-10 03:20  ArcSoftFace\ArcSoftFace\bin\Debug\libarcsoft_face.dll

     文件     388608  2019-05-10 03:20  ArcSoftFace\ArcSoftFace\bin\Debug\libarcsoft_face_engine.dll

     文件     519287  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\doc\ArcSoftFace C# Demo说明文档.pdf

     文件        162  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\doc\~$cSoftFace说明文档.docx

     文件        460  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\Entity\FaceTrackUnit.cs

     文件        578  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\Entity\ImageInfo.cs

     文件      43871  2019-05-21 17:26  ArcSoftFace\ArcSoftFace\FaceForm.cs

     文件      13740  2019-05-13 10:23  ArcSoftFace\ArcSoftFace\FaceForm.Designer.cs

     文件      81543  2019-05-13 10:48  ArcSoftFace\ArcSoftFace\FaceForm.resx

     文件       4286  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\favicon.ico

     文件      44544  2019-03-25 03:30  ArcSoftFace\ArcSoftFace\lib\AForge.Controls.dll

............此处省略70个文件信息

评论

共有 条评论