【发布时间】:2017-11-25 18:08:47
【问题描述】:
所以,我想使用 kinect v2 for windows 进行面部识别。 我什至不知道从哪里开始。我已经尝试了很多这样的事情:
private CascadeClassifier _cascadeClassifier;
_cascadeClassifier = new CascadeClassifier(Application.StartupPath + "/haarcascade_frontalface_alt_tree.xml");
using (var imageFrame = _capture.QueryFrame().ToImage<Bgr, Byte>())
{
if (imageFrame != null)
{
var grayframe = imageFrame.Convert<Gray, byte>();
var faces = _cascadeClassifier.DetectMultiScale(grayframe, 1.1, 10, Size.Empty); //the actual face detection happens here
foreach (var face in faces)
{
imageFrame.Draw(face, new Bgr(Color.BurlyWood), 3); //the detected face(s) is highlighted here using a box that is drawn around it/them
}
}
imgCamUser.Image = imageFrame;
}
但我总是认为“面孔”是空引用。我按照本教程 (http://ahmedopeyemi.com/main/face-detection-and-recognition-in-c-using-emgucv-3-0-opencv-wrapper-part-1/) 进行操作,但由于使用的是 wpf 而不是 windows 窗体,所以我无法制作 imagebox 和其他东西。
我还尝试了 stackoverflow 上其他人所说的,但也没有用(例如: Kinect Facial Recognition and Training Images)。
我认为最好的方法是使用 emguCV(openCV for c#)。我知道,对于人脸识别,我需要先检测我的脸,而不是将其保存在文件中的某个位置,然后才能将相机上的当前人脸与我的“人脸文件夹”中所有保存的人脸进行比较。
如果已经存在某种只调用它们的函数,那就太棒了,因为我已经有 600 行 kinect 代码(比如身体跟踪、手势和语音检测以及语音命令等...)
感谢大家的帮助!
【问题讨论】: