资源简介
通过摄像头进行视频抓取,识别人脸、人眼,并自动保存成图片。
1.需要自行安装emgu的库,并设置好path,可官网下载
2.需要自行准备好摄像头并安装好驱动
3.需要vs2012或者SharpDevelop进行编译,bin下已有编译好的exe
官网例子,参考官网和一些资料,代码比较简单。大家也仅供参考。
代码片段和文件信息
//----------------------------------------------------------------------------
// Copyright (C) 2004-2012 by EMGU. All rights reserved.
//----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.CV.GPU;
namespace emguDemo
{
public static class DetectFace
{
public static void Detect(Image image String faceFileName String eyeFileName List faces List eyes out long detectionTime)
{
Stopwatch watch;
if (GpuInvoke.HasCuda)
{
using (GpuCascadeClassifier face = new GpuCascadeClassifier(faceFileName))
using (GpuCascadeClassifier eye = new GpuCascadeClassifier(eyeFileName))
{
watch = Stopwatch.StartNew();
using (GpuImage gpuImage = new GpuImage(image))
using (GpuImage gpuGray = gpuImage.Convert())
{
Rectangle[] faceRegion = face.DetectMultiScale(gpuGray 1.1 10 Size.Empty);
faces.AddRange(faceRegion);
foreach (Rectangle f in faceRegion)
{
using (GpuImage faceImg = gpuGray.GetSubRect(f))
{
//For some reason a clone is required.
//Might be a bug of GpuCascadeClassifier in opencv
// using (GpuImage clone = faceImg.Clone())
// {
// Rectangle[] eyeRegion = eye.DetectMultiScale(clone 1.1 10 Size.Empty);
//
// foreach (Rectangle e in eyeRegion)
// {
// Rectangle eyeRect = e;
// eyeRect.Offset(f.X f.Y);
// eyes.Add(eyeRect);
// }
// }
}
}
}
watch.Stop();
}
}
else
{
//Read the HaarCascade objects
using (CascadeClassifier face = new CascadeClassifier(faceFileName))
using (CascadeClassifier eye = new CascadeClassifier(eyeFileName))
{
watch = Stopwatch.StartNew();
using (Image gray = image.Convert()) //Convert it to Grayscale
{
//normalizes brightness and increases contrast of the image
gray._EqualizeHist();
//Detect the faces from the gray scale image and store the locations as rectangle
//The first dimensional is the channel
//The second dimension is
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-04-07 14:09 emguDemo\
目录 0 2014-04-08 17:34 emguDemo\emguDemo\
文件 942 2014-04-07 14:09 emguDemo\emguDemo.sln
文件 51712 2014-04-07 22:00 emguDemo\emguDemo.v11.suo
文件 167 2014-04-07 15:06 emguDemo\emguDemo\App.config
目录 0 2014-04-07 17:47 emguDemo\emguDemo\bin\
目录 0 2014-04-08 17:33 emguDemo\emguDemo\bin\Debug\
文件 294912 2012-08-20 13:49 emguDemo\emguDemo\bin\Debug\Emgu.CV.dll
文件 49152 2012-08-20 13:49 emguDemo\emguDemo\bin\Debug\Emgu.CV.GPU.dll
文件 147862 2012-08-20 13:49 emguDemo\emguDemo\bin\Debug\Emgu.CV.GPU.xm
文件 36864 2012-08-20 13:49 emguDemo\emguDemo\bin\Debug\Emgu.CV.ML.dll
文件 133267 2012-08-20 13:49 emguDemo\emguDemo\bin\Debug\Emgu.CV.ML.xm
文件 126976 2012-08-20 13:49 emguDemo\emguDemo\bin\Debug\Emgu.CV.UI.dll
文件 35149 2012-08-20 13:49 emguDemo\emguDemo\bin\Debug\Emgu.CV.UI.xm
文件 1185017 2012-08-20 13:49 emguDemo\emguDemo\bin\Debug\Emgu.CV.xm
文件 32768 2012-08-20 12:41 emguDemo\emguDemo\bin\Debug\Emgu.Util.dll
文件 22236 2012-08-20 12:41 emguDemo\emguDemo\bin\Debug\Emgu.Util.xm
文件 12800 2014-04-07 17:41 emguDemo\emguDemo\bin\Debug\emguDemo.exe
文件 167 2014-04-07 15:06 emguDemo\emguDemo\bin\Debug\emguDemo.exe.config
文件 34304 2014-04-07 17:41 emguDemo\emguDemo\bin\Debug\emguDemo.pdb
文件 22472 2014-04-07 17:47 emguDemo\emguDemo\bin\Debug\emguDemo.vshost.exe
文件 167 2014-04-07 15:06 emguDemo\emguDemo\bin\Debug\emguDemo.vshost.exe.config
文件 490 2012-06-06 02:06 emguDemo\emguDemo\bin\Debug\emguDemo.vshost.exe.manifest
文件 521766 2012-07-25 11:57 emguDemo\emguDemo\bin\Debug\haarcascade_eye.xm
文件 1290445 2012-07-25 11:57 emguDemo\emguDemo\bin\Debug\haarcascade_frontalface_default.xm
文件 91814 2012-07-25 11:44 emguDemo\emguDemo\bin\Debug\lena.jpg
文件 307200 2012-07-25 11:44 emguDemo\emguDemo\bin\Debug\ZedGraph.dll
文件 1492968 2012-07-25 11:44 emguDemo\emguDemo\bin\Debug\ZedGraph.xm
目录 0 2014-04-08 16:31 emguDemo\emguDemo\bin\Debug\zh-CN\
文件 4096 2012-07-25 11:44 emguDemo\emguDemo\bin\Debug\zh-CN\ZedGraph.resources.dll
目录 0 2014-04-09 17:49 emguDemo\emguDemo\bin\Release\
............此处省略67个文件信息
相关资源
- 语音录音、合成、识别 C#科大讯飞源
- c#车牌识别系统完整实现
- c#下完整的人脸识别
- C#利用OneNote实现图片文字识别.zip
- VS C# OpenCV图像识别+文字打印
- 基于科大讯飞语音识别
- 虹软人脸识别ArcFace 2.1 (C# 修改官方
- 中控指纹识别 SDK_Ver2.3.3.5
- asp.net+websocket+emgucv实现人脸识别完整
- libemgucv-windesktop-3.3.0.2824.exe
- C#实现BP神经网络数字图像识别源码
- wpf 适用windows系统触屏的手写识别
- Unity+百度人脸识别程序包PC版exe
- C# 使用EmguCV 拼接图片用于多张照片合
- 海康人脸识别C#远程采集人脸、下发人
- 车牌抓拍识别_海康代码_C#
- C# 海康人脸识别主机demo,64位可运行
- C#海康识别抓拍回调(增加出入口LE
- C# 人脸识别Demo基于虹软免费SDK完整版
- 利用Emgu.CV实现人脸识别详解 (C#)
- ASP.net基于百度AI的在线人脸登陆,人
- EmguCV3.4.3
- c# 人脸识别源码和使用说明
- c# emgucv 实时绿幕抠像源码
- C#EmguCV 运动检测
- C#-EmguCV 特征匹配
- RGBHSV颜色统计程序
- C#车牌识别源码
- WPF利用Emgu CV调用计算机摄像头
- C#开发的图片识别程序 demo
评论
共有 条评论