header photo

Level 3e - How to Extract the Detected Faces From Input Image

Once faces have been detected from an input image, extract each single face out and save to a folder OR view on the windows form in a picturebox

NOTE: we're starting off with modifying the Camera Capture application, right where we left it at the end of Level 3d. how we connected to camera, got an input image, detected faces and marked them in boxes and displayed them - to know all that, please have a detailed look at Level 1 and then  Level 3a to Level 3d

STEP 1:  If you still haven't then Add a button to "Browse For Input Image" on your application.

STEP 2:  Insert the Code to "Extract a Faces" after face detection code.

STEP 3:  Add components/tools to Display the  "Extract Faces"  on your windows form.
Also create an array to hold all the extracted faces

STEP 4:  Add  each extracted face to the ExtractedFaces array. Then display each extracted face in the array to the picturebox. code behind the added buttons to navigate through the extracted faces array to display previous or next extracted face.

STEP 5: Handle the exception cases in navigating through the extracted faces.

STEP 6: Finalize the application with following modifications:


Go Back

Hi,thanks a lot for your topic!perfect and amazing!U are doing a great job!

You did a perfect description on this topic. Helpful, clearly commented and easy to follow: PERFECT!!!
I'd wish, there would be a company publishing your tutorial and much more topics of EmguCV (presented with this quality) commercially on DVD. Thanks a lot!

really great tutorials u really rock
i always used to feel that girls and programming it not a good combo,but u really rock
can u plz go in a little more details like eye tracking,nose.

really really great c:

Thanks Mahvish. I have gone through all the tutorials. The tutorial has been very helpful. I would appreciate it if you could help me with giving some idea or lecture on extracting facial features(like eyes,noes, mouth etc.) from a detected a face. Thank You.

Hi your all tutorials are great but why these images/videos in other and this tutorials are not displaying?

Thanks so much :)

Hi! Thanks for your examples, they are well documented and thorough. I've implemented your code (by actually typing it, not just copy paste..) and everything works like a charm. One thing i don't like, and that has been my issue since the first time i started using emgucv/opencv, is the Haar principle. Sure, it works but not as good as i want it to be.

To fix that, i thought it would be quite simple to make the border around the face a bit bigger. Might be a few false positives more, but for my project it's necassary.

In processframe i've implemented the part where you copy the inside of the border and paste it into a new image. Works like a charm. But how can i make sure that there are some extra pixels copied? The "face.rect" can't be edited, unfortunately, so i'm kinda stuck. Do i need to make my own vectors, or is there a simpler way?

Also, if you do have the time to make a NORMAL tutorial on how to train the program and make your own vectors, that would be quite awesome. You're a programmer, but you have one big plus against others: you speak normal English lol, and for a beginner/novice in C# that's great. I understand more and more, learned a lot in the past 1.5 hours!

thanks so much. it's great.

i need help in eye extraction
any help plz