MTCNN+人脸动态贴纸源码+DEMO


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.vsTestDemov14.suo

     文件     168368  2019-01-02 15:26  TestDemoTestDemoinReleasea.jpg

     文件     201295  2019-01-02 14:58  TestDemoTestDemoinRelease.jpg

     文件     182497  2019-01-02 15:25  TestDemoTestDemoinReleasemask_a.png

     文件     100783  2019-01-02 15:03  TestDemoTestDemoinReleasemask_b.png

     文件     165955  2019-01-02 14:52  TestDemoTestDemoinReleasemodel.jpg

     文件     362496  2019-01-02 16:03  TestDemoTestDemoinReleaseTestDemo.exe

     文件      90624  2019-01-02 16:03  TestDemoTestDemoinReleaseTestDemo_C.dll

     文件       9245  2019-01-02 16:03  TestDemoTestDemoForm1.cs

     文件       8113  2019-01-02 16:03  TestDemoTestDemoForm1.Designer.cs

     文件     524669  2019-01-02 16:03  TestDemoTestDemoForm1.resx

     文件        500  2015-05-05 11:41  TestDemoTestDemoProgram.cs

     文件       1428  2015-05-05 11:41  TestDemoTestDemoPropertiesAssemblyInfo.cs

     文件       2846  2015-05-05 11:41  TestDemoTestDemoPropertiesResources.Designer.cs

     文件       5612  2015-05-05 11:41  TestDemoTestDemoPropertiesResources.resx

     文件       1095  2015-05-05 11:41  TestDemoTestDemoPropertiesSettings.Designer.cs

     文件        249  2015-05-05 11:41  TestDemoTestDemoPropertiesSettings.settings

     文件       2727  2019-01-02 14:16  TestDemoTestDemoTestBitmap.cs

     文件       5677  2016-03-14 18:12  TestDemoTestDemoTestDemo.csproj

     文件        638  2015-05-05 12:41  TestDemoTestDemoTestDemo.csproj.user

     文件       2515  2015-05-05 11:49  TestDemoTestDemo.sln

    ..A..H.     35328  2019-01-02 10:11  TestDemoTestDemo.suo

     文件   30433280  2019-01-02 16:51  TestDemoTestDemo.VC.db

     文件       1709  2018-10-06 18:34  TestDemoTestDemo_Crowse.h

     文件      26548  2018-10-06 18:34  TestDemoTestDemo_Cmodelsdet1.bin

     文件        943  2018-10-06 18:34  TestDemoTestDemo_Cmodelsdet1.param

     文件     400736  2018-10-06 18:34  TestDemoTestDemo_Cmodelsdet2.bin

     文件       1122  2018-10-06 18:34  TestDemoTestDemo_Cmodelsdet2.param

     文件    1556192  2018-10-06 18:34  TestDemoTestDemo_Cmodelsdet3.bin

     文件       1522  2018-10-06 18:34  TestDemoTestDemo_Cmodelsdet3.param

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

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)