资源简介
实现了以下接口
https://api-cn.faceplusplus.com/facepp/v3/compare
https://api-cn.faceplusplus.com/facepp/v3/detect
https://api-cn.faceplusplus.com/facepp/v3/faceset/create
https://api-cn.faceplusplus.com/facepp/v3/faceset/addface
https://api-cn.faceplusplus.com/facepp/v3/search
人脸识别,人脸集合创建,查找,两张人脸图片比对
并对返回结果的json反序列化到实体对象,结果一目了然。
注: 前提需要创建一个免费的测试账号-------
//注册自己的face++账号,地址:https://console.faceplusplus.com.cn/register
String strApiKey = "";
String strApiSecret = "";
//如果需要上传人脸到人脸集合,请先创建人脸集合后填入得到的facesetToken, 人脸添加到人脸集合时需要用它制定哪个集合
String strFacesetToken = "";
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.xml.Linq;
using WindowsFormsApplication1.Entities;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
String picPath1 = ““;
String picPath2 = ““;
//OuterId:账号下全局唯一的 FaceSet 自定义标识,可以生成一个UUID作为outer_id
String strOuterId = “26c543b95fa142a5985c0aaab8b854d2“;//System.Guid.NewGuid().ToString(“N“);
//注册自己的face++账号,地址:https://console.faceplusplus.com.cn/register
String strApiKey = ““;
String strApiSecret = ““;
//请先创建人脸集合后填入得到的facesetToken 人脸添加到人脸集合时需要用它制定哪个集合
String strFacesetToken = ““;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.title = “选择文件“;
openFileDialog.Filter = “jpg文件|*.jpg|png文件|*.png|所有文件|*.*“;
openFileDialog.FileName = string.Empty;
openFileDialog.FilterIndex = 1;
openFileDialog.RestoreDirectory = true;
openFileDialog.DefaultExt = “jpg“;
DialogResult result = openFileDialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.Cancel)
{
return;
}
String filepath = openFileDialog.FileName;
pictureBox1.ImageLocation = filepath;
picPath1 = filepath;
}
private void button2_Click(object sender EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.title = “选择文件“;
openFileDialog.Filter = “jpg文件|*.jpg|png文件|*.png|所有文件|*.*“;
openFileDialog.FileName = string.Empty;
openFileDialog.FilterIndex = 1;
openFileDialog.RestoreDirectory = true;
openFileDialog.DefaultExt = “jpg“;
DialogResult result = openFileDialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.Cancel)
{
return;
}
String filepath = openFileDialog.FileName;
pictureBox2.ImageLocation = filepath;
picPath2= filepath;
}
private void button3_Click(object sender EventArgs e)
{
Dictionaryject> verifyPostParameters = new Dictionaryject>();
verifyPostParameters.Add(“api_key“ strApiKey);
verifyPostParameters.Add(“api_secret“ strApiSecret);
Bitmap bmp = new Bitmap(picPath1); // 图片地址
byte[] fileIma
- 上一篇:c#上位机串口通信助手源代码
- 下一篇:AES加密算法C#实现带中文说明
相关资源
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
评论
共有 条评论