• 大小: 17.56MB
    文件类型: .rar
    金币: 2
    下载: 0 次
    发布日期: 2024-01-29
  • 语言: 其他
  • 标签: C#  EMGUCV  

资源简介

Emgu.CV 打开视频与人脸检测,可以运行,Emgu.CV应用3.4.0,BIN中有相关DLL,打开视频方法:USB,RTSP,HTTP取图片,本地录像。打开视频方法切换时先停止上一次打开。打开视频后分析检测视频中人脸

资源截图

代码片段和文件信息

using Emgu.CV;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        private Mat curframe;
        private WebClientExt webClient;
        private VideoCapture videoCapture;
        private KingFaceDetect m_KingFaceDetect;
        public Form1()
        {
            m_KingFaceDetect = new KingFaceDetect();
            InitializeComponent();
        }

        private void button1_Click(object sender EventArgs e)
        {
            videoCapture = new VideoCapture(0);
            videoCapture.ImageGrabbed += Processframe;
           
            videoCapture.Start();
        }

        private void Processframe(object sender EventArgs arg)
        {
            try
            {
                videoCapture.ImageGrabbed -= Processframe;
                //if (videoCapture != null && videoCapture.Ptr != IntPtr.Zero &&
                //    videoCapture.CaptureSource == VideoCapture.CaptureModuleType.Camera)
                if (videoCapture != null && videoCapture.Ptr != IntPtr.Zero )
                {
                    curframe = null;

                    curframe = videoCapture.Queryframe();
                    if (curframe != null)
                    {
                        imgSource.Image = m_KingFaceDetect.faceRecognize (curframe).originalImg;
                      
                    }
                }
            }
            catch (Exception e1)
            {
              //  LogHelper.Error(e1.Message + “Source:“ + e1.Source + “StackTrace:“ + e1.StackTrace);

            }
            videoCapture.ImageGrabbed += Processframe;
        }

        private void Form1_FormClosed(object sender FormClosedEventArgs e)
        {
            videoCapture.Stop();
        }

        private void button2_Click(object sender EventArgs e)
        {
            string str = @“rtsp://admin:123456@192.168.10.101:554/h265/ch1/main/av_stream“;
            videoCapture = new VideoCapture(str);
            videoCapture.ImageGrabbed += Processframe;
            videoCapture.Start();
        }
     
        private void button3_Click(object sender EventArgs e)
        {
            //string str = @“http://admin:123456@192.168.10.123/jpgimage/1/image.jpg“;
            //videoCapture = new VideoCapture(str);
            //videoCapture.ImageGrabbed += Processframe;
            isConnectted = true;
            // videoCapture.Start();
            timer1.Enabled = true;
             webClient = new WebClientExt(500);

            NetworkCredential nc = new NetworkCredential(“admin“ “admin“);
            webClient.Credentials = nc;
            webClient.Proxy = null;
        }

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

     文件        189  2019-01-30 11:40  WindowsFormsApplication2\WindowsFormsApplication2\App.config

     文件      82380  2019-01-31 09:41  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\002

     文件     331432  2018-01-14 01:32  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\concrt140.dll

     文件   31507968  2018-04-04 23:15  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\cvextern.dll

     文件       7680  2018-04-04 23:15  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\Emgu.CV.DebuggerVisualizers.VS2015.dll

     文件     117760  2018-04-04 23:15  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\Emgu.CV.UI.dll

     文件      27136  2018-04-04 23:15  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\Emgu.CV.UI.GL.dll

     文件     665088  2018-04-04 23:15  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\Emgu.CV.World.dll

     文件     609280  2018-04-04 23:15  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\Emgu.CV.World.NetStandard1_4.dll

     文件     341406  2016-01-12 03:16  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\haarcascade_eye.xml

     文件     930127  2016-01-12 03:16  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\haarcascade_frontalface_default.xml

     文件     641696  2018-01-14 01:32  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\msvcp140.dll

     文件   18053632  2018-04-04 22:42  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\opencv_ffmpeg341_64.dll

     文件      87728  2018-01-14 01:32  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\vcruntime140.dll

     文件      15360  2019-01-31 09:44  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.exe

     文件        189  2019-01-30 11:40  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.exe.config

     文件      34304  2019-01-31 09:44  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.pdb

     文件      22688  2019-01-31 09:33  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe

     文件        189  2019-01-30 11:40  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe.config

     文件        490  2017-09-29 21:43  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.vshost.exe.manifest

     文件      26929  2018-02-08 23:14  WindowsFormsApplication2\WindowsFormsApplication2\bin\Debug\ZedGraph.license.txt

     文件       4263  2019-01-31 09:44  WindowsFormsApplication2\WindowsFormsApplication2\Form1.cs

     文件       6647  2019-01-31 09:44  WindowsFormsApplication2\WindowsFormsApplication2\Form1.Designer.cs

     文件       6011  2019-01-31 09:44  WindowsFormsApplication2\WindowsFormsApplication2\Form1.resx

     文件       7044  2019-01-30 16:05  WindowsFormsApplication2\WindowsFormsApplication2\KingFaceDetect.cs

     文件        868  2019-01-31 09:43  WindowsFormsApplication2\WindowsFormsApplication2\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7918  2019-01-31 09:39  WindowsFormsApplication2\WindowsFormsApplication2\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2019-01-31 09:39  WindowsFormsApplication2\WindowsFormsApplication2\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2019-01-31 09:39  WindowsFormsApplication2\WindowsFormsApplication2\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2019-01-31 09:39  WindowsFormsApplication2\WindowsFormsApplication2\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

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

评论

共有 条评论