emguCV 3.1-人脸检测 [英] emguCV 3.1 - face detection

查看:196
本文介绍了emguCV 3.1-人脸检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是C#中的OpenCV/EmguCV的新手. 我尝试了一个教程( http://littletutorials.bravesites.com/entries/emgu-cv-c/level-3---live-face-detection ),使用网络摄像头轻松捕获视频.现在我的问题是: 该教程是为EmguCV 2.x编写的.我正在使用EmguCV 3.1(我喜欢使用最新的).因此,我使用类Mat代替类Image<>.类Image<>不适用于capture.QueryFrame(); 但是当我面对人脸检测时,该教程说我应该使用CascadeClassifierDetectHaarCascade类. CascadeClassifier被接受,但DetectHaarCascade未知. 在我的5小时内!搜索我刚刚发现,DetectHaarCascade已过时,但没有找到任何替代它的方法,除了HaarCascade.Detect()之外,这也是未知的.

I'm new to OpenCV/EmguCV in C#. I tried a tutorial (http://fewtutorials.bravesites.com/entries/emgu-cv-c/level-3---live-face-detection) and the video captureing with the webcam was easy. Now my problem: The tutorial was written for EmguCV 2.x. I'm using EmguCV 3.1 (I like to use the newest). Therefor I used the class Mat instead of the class Image<>. The class Image<> hasn't worked with capture.QueryFrame(); But when I come to face detection, the tutorial says I should use the classes CascadeClassifier and DetectHaarCascade. CascadeClassifier is accepted but DetectHaarCascade is not known. In my 5-hour!! search I just found out, that DetectHaarCascade is obsolete but didn't find any methods replacing it exept HaarCascade.Detect() which is also not known.

我有以下检举:

using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.Util;
using Emgu.CV.CvEnum;

所以,请帮助我:DetectHaarCascade的替代品是什么,如何使用? EmguCV 3.1有任何教程吗?

So, please help me: What is the replacement for DetectHaarCascade and how do I use it? Is there any tutorial for EmguCV 3.1?

谢谢!

推荐答案

henne959,我对emgu c#还是很陌生-但在opencv领域有些了解.首先要意识到的是它的发展.名称更改.因此,请保持开放的态度.我最近使用la emgu c#(3.0)进行面部检测,发现了您提到的教程. CascadeClassifier 类在那里.但是,我发现HAAR检测器(我想使用)体现为该类的扩展: DetectMultiScale

henne959, I am also fairly new to emgu c# - but have been around the opencv realm a little. First thing to realize is that it evolves. Names change. So keep an open mind. I recently played around with face detection a la emgu c# (3.0) and found the tutorial you mentioned. The CascadeClassifier class is there. But, I found the HAAR detector (that I wanted to use) manifest as an extension to that class: DetectMultiScale

在研究此主题时我注意到的链接中-这两个是我最喜欢的(对不起-我没有代表点以包括更多链接) http://fewtutorials .bravesites.com/entries/emgu-cv-c/level-3c ---如何改善面部检测 http://blogs.interknowlogy.com/2013/10/21/face-detection-for-net-using-emgucv/

Among the links I noted while researching this topic - these two were among my favorite (sorry - I don't have the rep points to include more links) http://fewtutorials.bravesites.com/entries/emgu-cv-c/level-3c---how-to-improve-face-detection http://blogs.interknowlogy.com/2013/10/21/face-detection-for-net-using-emgucv/

这两行代码可能会帮助您将各个部分绑在一起

These two lines of code will probably help you tie the pieces together

CascadeClassifier _cascadeClassifier = new CascadeClassifier(@"C:\OPENCV_3.0.0\opencv\build\etc\haarcascades\" + "haarcascade_frontalface_alt2.xml");

Rectangle RectFaces = _cascadeClassifier.DetectMultiScale(tMat, 1.03, 1, new Size(tMat.Width/13, tMat.Height/13), new Size((int)((double)tMat.Width/1.05), (int)((double)tMat.Width / 1.05)));

希望这会有所帮助!

这篇关于emguCV 3.1-人脸检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆