How to detect faces in image or video?

asked 2016-10-17 11:12:12 -0600

Is training haar cascade necessary?because iam trying to use the default frontal_face_default.xml file but is not working and i am using open cv2.4.13 and jdk 6 with it.

edit retag flag offensive close merge delete

Comments

no, training your own cascade migt not be nessecary, and most likely, your existing cascade was simply not loaded due to a wrong path.

please check cascade.empty() after loading, rinse & repeat.

berak gravatar imageberak ( 2016-10-17 11:51:48 -0600 )edit

also, please add some lines of code, where you try to load it to your question

berak gravatar imageberak ( 2016-10-17 11:53:34 -0600 )edit

Hello Berak, i am also trying to use face detection using haar cascade files in c. i am facing the same problem, it is unable to load the file. can you please provide the link for its solution. or can you please provide the solution in c-languge.

thanks in advance, Saurabh

saurabh_bansal gravatar imagesaurabh_bansal ( 2016-10-17 15:53:33 -0600 )edit

@saurabh, you must not use opencv's c-api (it's dead, no more maintained), but c++, and the tutorial is here

berak gravatar imageberak ( 2016-10-17 17:36:19 -0600 )edit

have you tried specifying the absolute path? It happened very often to me that things were not loaded properly if I used the relative path.

benT gravatar imagebenT ( 2016-10-18 10:36:26 -0600 )edit