2017-06-22 117 views
1

所以,我想使用kinect v2進行面部識別。 我甚至不知道從哪裏開始。我試過一堆這樣的東西:kinect v2.0面部識別(wpf)c#

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;      
       } 

但我總是得到那個「faces」是空引用。我遵循本教程(http://ahmedopeyemi.com/main/face-detection-and-recognition-in-c-using-emgucv-3-0-opencv-wrapper-part-1/),但由於使用wpf而不是windows窗體,因此無法制作圖像盒和其他內容。

我也試過別人在stackoverflow說,它也沒有工作(如: Kinect Facial Recognition and Training Images)。

我認爲最好的方法是使用emguCV(openCV for c#)。我知道,爲了識別臉部,我需要首先檢測我的臉部,而不是將其保存在文件的某個位置,然後才能將相機上的當前臉部彈出到我的「臉部文件夾」中的所有已保存的臉部。

如果已經存在某種函數來調用它們,因爲我已經有600行kinect東西代碼(比如身體跟蹤,手勢和語音檢測以及語音命令等等),這真的很棒。 )

感謝您的幫助!

回答

0

如果你正在尋找面部識別算法,你可以測試this之一。 確實,它沒有在Windows中測試過,也沒有使用深度數據,這是kinect提供的與普通相機不同的最佳功能。但是,如果你只想找到簡單和用戶友好的算法,你可以給這個github倉庫一個機會。