1

I'm using the opencv tutorial for face detection I have done exactly how they explained, and the code works fine but the part where the xml file should be loaded is giving me the error msg!

if( !face_cascade.load( face_cascade_name ) ){ printf("--(!)Error loading\n"); return -1; };

if( !eyes_cascade.load( eyes_cascade_name ) ){ printf("--(!)Error loading\n"); return -1; };

I have the cascade xml files in my directory.

When I make these two lines as comments, the code works fine and the cam turns on but of course it doesn't detect my face!

4

2 回答 2

1

这里有一些隐藏的假设,即程序级联文件所在的同一目录开始。在你的情况下可能不是这样。

我敢打赌它运行正确,如果你指定一个绝对路径

String face_cascade_name = "c:/la/la/la/haarcascade_frontalface_alt.xml";

eyes_cascade.

于 2013-10-15T21:32:38.217 回答
0

当您在路径或绝对路径上没有错误时,您应该查看您的链接库是否错误;可能您在调试配置中链接发布库,或者您将所有发布库和调试库放在您的项目中。

于 2014-05-12T04:50:53.710 回答