简体   繁体   中英

kinect v2.0 facial recognition (wpf) c#

So, I want to make facial recognition using kinect v2 for windows. I don't know even where to start. I tried already a bunch of things like this:

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

but I always get that "faces" are null reference. I followed this tutorial ( http://ahmedopeyemi.com/main/face-detection-and-recognition-in-c-using-emgucv-3-0-opencv-wrapper-part-1/ ) but I can't make imagebox and other stuff, due to using wpf and not windows forms.

I also tried what others on stackoverflow said and it also didn't work (like: Kinect Facial Recognition and Training Images ).

I think that the best way to do this is using emguCV (openCV for c#). I know that for face recognition I need to first detect my face, than save it somewhere in a file and only then can I compere the current face on the camera to all the saved faces in my "folder of faces".

It would be really awesome if there already existed some sort of functions to only call them, because I already have 600 lines of code of kinect stuff (like body tracking and gesture and voice detection and voice commands, etc...)

Thanks for all the help!

If you looking for facial recognition algorithm you can test this one. It is true that it is not tested in Windows and not use depth data which is best things that kinect provides unlike usual camera. But still, if you just interested in finding simple and user-friendly algorithm, you can give a chance to that github repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM