Basic Face Detection and Face Recognition Using OpenCV

Basic Face Detection and Face Recognition Using OpenCV

Detect faces and their eyes, nose and mouth in a web cam feed. Then calculate the rotation of each face. Next you can also capture the faces and store them in a format suitable for recognition. I then demonstrate working face recognition. This is done using OpenCV, the code is open-source and you can get it at: If you use it I would be happy to receive a notification of that. If you modify it, you are very welcome to commit your changes! Look at my website for a basic post of the framework: If you have trouble compiling OpenCV with visual studio 2010, look at: For information about compiling Boost with visual studio 2010, look at: I found the information and explanations about face detection, face tracking and face recognition from Robin Hewitt very useful:
Video Rating: 4 / 5

This entry was posted in YouTube and tagged , , , , , . Bookmark the permalink.

18 Responses to Basic Face Detection and Face Recognition Using OpenCV

  1. jenny yao says:

    Thanks very much! I want to know if I can call this dll files in the labview?So this project can run in the labview?

  2. TheMarchellio says:

    what algorithm you used in this detection?

  3. jenny yao says:

    It can run.But there is no video.

  4. jenny yao says:

    hello,it’s great work! Now I follow your steps to let the window comes out,but my webcam cann’t connect with it.I don’t konw how to connect it with webcam.Can you help me?Thanks very much.

  5. toefel18 says:

    Hey nishant, I won’t be able to provide you with help, I am too limited in time, You could add code to do expression recognition, but you’d have to write that yourself.

  6. nishant pandey says:

    hiiiiiiii,,,,,,,great work could u plz tell me that  u r code can be modified in to expression recognition………or any other help from u r side……

  7. toefel18 says:

    Google code, search for visual-control

  8. jose alexander contreras del orbe says:

    where or how i can get the source code of this program.

  9. KUMAR ABHAY says:

    any help for interact with processing???….i need….!! Thanks..!!

  10. MelaTheTrololol says:

    It fixed that problem when using an older version. However, a new problem occured: 1>cognitiondetectordetailedfacedetector.cpp(118): error C2248: ‘DO_CANNY_PRUNING’ : cannot access protected enumerator declared in class ‘cv::CascadeClassifier’ 1> C:OpenCV 2.4.3buildincludeopencv2/objdetect/objdetect.hpp(411) : see declaration of ‘DO_CANNY_PRUNING’ 1> C:OpenCV 2.4.3buildincludeopencv2/objdetect/objdetect.hpp(369) : see declaration of ‘cv::CascadeClassifier’

  11. MelaTheTrololol says:

    I have Boost 1.52.0, so you might be right. I’ll have a look at it momentarily, and keep you updated :) Thanks

  12. toefel18 says:

    I have no idea why that would fail, maybe you should look into boost::filesystem maybe you are using a version that has removed the method (if it does not compile) or if it gives you problems at runtime, the method’s behavior might have changed. That’s all I can guess..

  13. MelaTheTrololol says:

    Yeah, that’s exactly what I meant :)

  14. toefel18 says:

    What is the actual problem? what do you mean with located, do you mean that file-filename() gives you an error? 

  15. MelaTheTrololol says:

    I succesfully installed all the needed packages, and I almost got the face detection system to work. However, one problem remains; the visualcontrol.cpp file. ___________________________________________ for(directory_iterator file(dir); file != end; ++file){ if(is_regular_file(*file)) recognizer->addTrainingImage(file->path().string(), file->filename()); } ___________________________________________ “filename” cannot be located as far as I can see—any idea how to fix this problem?

  16. Miguel Braga says:

    How can i get the source code from this program. I’m trying create a project that capture mutiple images from webcam using Microsoft Visual Studio c++ 2010 Express using OpenCV librarie… Can anyone help me please?

  17. padmavati999 says:

    hi…. can i get this code using JAVA….. If yes plz mail me at Thank you.

  18. Danie Danial says:

    /watch?v=-ElSxkrJz9U Face recognition source code

Leave a Reply