资源简介
1,MTCNN人脸检测C代码调用,实现人脸检测+关键点,不依赖opencv等第三方库;
2,人像静态/动态贴纸滤镜特效源码;
一键实现静态/动态贴纸特效;
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.IO;
namespace TestDemo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
zp = new TestDemo.TestBitmap();
try
{
zp.FDInitialize();
fdInitialize = true;
}
catch (Exception) { fdInitialize = false; }
}
#region 变量声明
//图像路径
private String curFileName = null;
//当前图像变量
private Bitmap curBitmap = null;
//原始图像变量
private Bitmap srcBitmap = null;
TestBitmap zp = new TestBitmap();
private bool fdInitialize = false;
#endregion
#region 图像打开保存模块
//打开图像函数
public void OpenFile()
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = “所有图像文件 | *.bmp; *.pcx; *.png; *.jpg; *.gif;“ +
“*.tif; *.ico; *.dxf; *.cgm; *.cdr; *.wmf; *.eps; *.emf|“ +
“位图( *.bmp; *.jpg; *.png;...) | *.bmp; *.pcx; *.png; *.jpg; *.gif; *.tif; *.ico|“ +
“矢量图( *.wmf; *.eps; *.emf;...) | *.dxf; *.cgm; *.cdr; *.wmf; *.eps; *.emf“;
ofd.ShowHelp = true;
ofd.title = “打开图像文件“;
if (ofd.ShowDialog() == DialogResult.OK)
{
curFileName = ofd.FileName;
try
{
curBitmap = (Bitmap)System.Drawing.Image.FromFile(curFileName);
srcBitmap = new Bitmap(curBitmap);
}
catch (Exception exp)
{ MessageBox.Show(exp.Message); }
}
}
//保存图像函数
public void SaveFile()
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = @“Bitmap文件(*.bmp)|*.bmp|Jpeg文件(*.jpg)|*.jpg|PNG文件(*.png)|*.png|所有合适文件(*.bmp*.jpg*.png)|*.bmp;*.jpg;*.png“;
sfd.FilterIndex = 3;
sfd.RestoreDirectory = true;
if (sfd.ShowDialog() == DialogResult.OK)
{
ImageFormat format = ImageFormat.Jpeg;
switch (Path.GetExtension(sfd.FileName).ToLower())
{
case “.jpg“:
format = ImageFormat.Jpeg;
break;
case “.bmp“:
format = ImageFormat.Bmp;
break;
case “.png“:
format = ImageFormat.Png;
break;
default:
MessageBox.Show(“Unsupported image format was specified!“);
return;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 90624 2019-01-02 16:51 TestDemo\.vs\TestDemo\v14\.suo
文件 168368 2019-01-02 15:26 TestDemo\TestDemo\bin\Release\a.jpg
文件 201295 2019-01-02 14:58 TestDemo\TestDemo\bin\Release\b.jpg
文件 182497 2019-01-02 15:25 TestDemo\TestDemo\bin\Release\mask_a.png
文件 100783 2019-01-02 15:03 TestDemo\TestDemo\bin\Release\mask_b.png
文件 165955 2019-01-02 14:52 TestDemo\TestDemo\bin\Release\model.jpg
文件 362496 2019-01-02 16:03 TestDemo\TestDemo\bin\Release\TestDemo.exe
文件 90624 2019-01-02 16:03 TestDemo\TestDemo\bin\Release\TestDemo_C.dll
文件 9245 2019-01-02 16:03 TestDemo\TestDemo\Form1.cs
文件 8113 2019-01-02 16:03 TestDemo\TestDemo\Form1.Designer.cs
文件 524669 2019-01-02 16:03 TestDemo\TestDemo\Form1.resx
文件 500 2015-05-05 11:41 TestDemo\TestDemo\Program.cs
文件 1428 2015-05-05 11:41 TestDemo\TestDemo\Properties\AssemblyInfo.cs
文件 2846 2015-05-05 11:41 TestDemo\TestDemo\Properties\Resources.Designer.cs
文件 5612 2015-05-05 11:41 TestDemo\TestDemo\Properties\Resources.resx
文件 1095 2015-05-05 11:41 TestDemo\TestDemo\Properties\Settings.Designer.cs
文件 249 2015-05-05 11:41 TestDemo\TestDemo\Properties\Settings.settings
文件 2727 2019-01-02 14:16 TestDemo\TestDemo\TestBitmap.cs
文件 5677 2016-03-14 18:12 TestDemo\TestDemo\TestDemo.csproj
文件 638 2015-05-05 12:41 TestDemo\TestDemo\TestDemo.csproj.user
文件 2515 2015-05-05 11:49 TestDemo\TestDemo.sln
..A..H. 35328 2019-01-02 10:11 TestDemo\TestDemo.suo
文件 30433280 2019-01-02 16:51 TestDemo\TestDemo.VC.db
文件 1709 2018-10-06 18:34 TestDemo\TestDemo_C\browse.h
文件 26548 2018-10-06 18:34 TestDemo\TestDemo_C\models\det1.bin
文件 943 2018-10-06 18:34 TestDemo\TestDemo_C\models\det1.param
文件 400736 2018-10-06 18:34 TestDemo\TestDemo_C\models\det2.bin
文件 1122 2018-10-06 18:34 TestDemo\TestDemo_C\models\det2.param
文件 1556192 2018-10-06 18:34 TestDemo\TestDemo_C\models\det3.bin
文件 1522 2018-10-06 18:34 TestDemo\TestDemo_C\models\det3.param
............此处省略113个文件信息
评论
共有 条评论