Ask Your Question

How to start to program face recognition?

asked 2013-04-13 09:54:22 -0600

Adrianos01 gravatar image

Hey There,

i want to write a program face recognition Program with OpenCV. This programm must do: If the face not in database send a sms to user. I have researched in internet that i can use for face recognation haarcascade...xml files or eigenface algorithm.

What ist better eigenface or haarcascade?

How can i start to write this program?

I use the System Linux and i have installed the OpenCV-Libraries and i can use OpenCV-Libraries with CodeBlocks.

Please help me with to write this project.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-04-13 10:23:08 -0600

berak gravatar image

updated 2013-04-13 10:27:32 -0600

the haarcascades are used for face detection, the eigen/fisher/lbp methods for face recognition

but a typical program will need both, a haar-detection first, to restrict the processing to the face area, and a face-recognizer after that.

let's think for now, that you got pre-cropped images of the persons (say, 90x90).

you create a facerecogizer:

Ptr<FaceRecognizer> model = createEigenFaceRecognizer();

then it needs to get trained. for every person you need some images(say 10), load them (grayscale), and put them into a vector<mat>. also you need to track which person it was, so it needs another vector<int> with person-ids, one for each image. now we can train it:

model->train(images, labels);

after that is done, you can test if it regognizes persons, you give it a grayscale image ( same size ) and call:

int predictedLabel = model->predict(testSample);

you'll get back the id of the person it was most similar to.

again, look here for the recognition example, and here for the detection

edit flag offensive delete link more



Thank you i will try it.

Adrianos01 gravatar imageAdrianos01 ( 2013-04-14 12:35:51 -0600 )edit

Question Tools


Asked: 2013-04-13 09:54:22 -0600

Seen: 1,101 times

Last updated: Apr 13 '13