lbpcascade_profileface.xml in OpenCV2.4.3 load failed

asked 2013-01-24 02:41:57 -0500

jarod gravatar image

updated 2013-01-24 04:08:43 -0500

I tried to use the lbpcascade_profileface.xml in OpenCV2.4.3 to make the profile face detect , but when I load the CascadeClassifier , it failed and memory exception , could anybody help me to solve this problem´╝čThanks very much in advance , my code is as below.

String cascadeNameLBPProfileFace =  "C:\\Users\\Administrator\\Desktop\\FaceDetect\\data\\lbpcascades\\lbpcascade_profileface.xml";  


CascadeClassifier cascadeLBP_Face;


when run to"cascadeLBP_Face.load(cascadeNameLBPProfileFace);" , the exception will happen , the hint is "Unhandled exception at 0x771015de in FaceDetect.exe: Microsoft C++ exception: cv::Exception at memory location 0x00fbe7f4.."

edit retag flag offensive close merge delete


If I use the sample in cpp/tutorial_code/objectDetection2.cpp and I replace face classifier by lbpcascade I've got the following error: OpenCV Error: Parsing error (/home/mbarnach/dev/opencv-git/data/lbpcascades/lbpcascade_profileface.xml(1): Comments are not allowed here) in icvXMLSkipSpaces, file opencv-git/modules/core/src/persistence.cpp, line 1788 terminate called after throwing an instance of 'cv::Exception' what(): opencv-git/modules/core/src/persistence.cpp:1788: error: (-212) opencv-git/data/lbpcascades/lbpcascade_profileface.xml(1): Comments are not allowed here in function icvXMLSkipSpaces Maybe it is a related error?

Mathieu Barnachon gravatar imageMathieu Barnachon ( 2013-01-24 06:55:07 -0500 )edit

I delete the comment lines in lbpcascade_profileface.xml , and it do worked , the error didn't happen again when load the file. But seems the cascadeclassifier can't detect profile faces.

jarod gravatar imagejarod ( 2013-01-25 01:15:57 -0500 )edit