Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not load lbpcascade_profile.xml

Tags:

c++

opencv

I am trying to load lbpcascade_profileface.xml.

CascadeClassifier cad;
cad.load("C:/opencv/data/lbpcascades/lbpcascade_profileface.xml");

Following error shows up:

OpenCV Error: Parsing error (C:/opencv/data/lbpcascades/lbpcascade_profileface.x
ml(1): Comments are not allowed here) in unknown function, file ..\..\..\src\ope
ncv\modules\core\src\persistence.cpp, line 1818

What to do ?

like image 723
Barshan Das Avatar asked Jan 14 '23 16:01

Barshan Das


2 Answers

Okay found the solution for working it. I had to delete the comments at top of the xml file. Now it works. But don't know why they had added comments that could not be parsed.

like image 126
Barshan Das Avatar answered Jan 16 '23 04:01

Barshan Das


I ran into the same issue and it appears the comment was just misplaced. If you want to preserve the comment, just move this line above the comment:

<?xml version="1.0"?>
like image 42
limi44 Avatar answered Jan 16 '23 06:01

limi44