2013-04-11 22 views
4

我正在嘗試加載lbpcascade_profileface.xml。無法加載lbpcascade_profile.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 

怎麼辦?

回答

5

好的找到了解決方案。我不得不刪除XML文件頂部的註釋。現在它可以工作。但不知道他們爲什麼添加了無法解析的評論。

4

我遇到了同樣的問題,看來評論只是錯位。如果您想保留評論,只需在評論上方移動此行:

<?xml version="1.0"?>