unable to detect face using example code (objectDetection.cpp) give in opencv 2.4.9

asked 2014-12-27 00:31:17 -0600

I am using opencv 2.4.9 and visual studio 2010. I have pasted haarcascade_eye_tree_eyeglasses.xml and haarcascade_frontalface_alt.xml in project directory. The program builds successfully, webcam turns ON but an empty output window appears when I run the code. I even tried giving full path of xml files but that dint help.

edit retag flag offensive close merge delete

Comments

Does the output window have any image; or is it black? If the image does not load then it might be an issue getting the camera to load.

Messina Vision Systems gravatar imageMessina Vision Systems ( 2014-12-28 02:45:53 -0600 )edit

Output window was blank when I ran that code. But when I tried some simpler codes like capturing video from webcam and save it to a file, everything works fine, so there might not be any problem with my webcam.

Ashwin D V gravatar imageAshwin D V ( 2014-12-29 07:46:38 -0600 )edit

check that capture = cvCaptureFromCAM( -1 ); is the same as the webcam example you ran. Then directly afterwards grab a frame = cvQueryFrame( capture ); and view it immediately. If this does not work then copy and paste what worked when you loaded it from the webcam.

Messina Vision Systems gravatar imageMessina Vision Systems ( 2014-12-29 08:06:43 -0600 )edit