4

我正在尝试加载lbpcascade_profileface.xml。

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

出现以下错误:

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

该怎么办 ?

4

2 回答 2

5

好的,找到了工作的解决方案。我不得不删除 xml 文件顶部的注释。现在它起作用了。但不知道为什么他们添加了无法解析的评论。

于 2013-04-11T09:56:57.247 回答
4

我遇到了同样的问题,看来评论放错了地方。如果要保留注释,只需将此行移到注释上方:

<?xml version="1.0"?>
于 2013-11-20T15:50:40.073 回答