Opencv error: Null pointer (Null filename) in an unknown face function. CPP

OpenCV contains an example of face recognition code. I tried using facedetect.cppfrom the OpenCV 2.2 library in my application. However, I ran into a runtime issue

OpenCV error: Null pointer(Null filename) in unknown function, file..\..\..\..\ocv\opencv\modules\core\src\persistence.cpp,line 2571

I looked for it and found that many people ran into this problem, but without a good solution. This problem occurred while loading the .xml file. My solution is here:

const char *cascadeNameChar=cascadeName.c_str();
const char *nestedCascadeNameChar=nestedCascadeName.c_str();
......
if( !cvLoad( nestedCascadeNameChar ) )
if(!cascade.load(cascadeName))

Then it works for me. I am running it on Visual Studio 2008.

+3
source share
1 answer

, . opencv2.2 + Visual Studio 2008, . Opencv2.2 - , http://sourceforge.net, vc2010. vc2010 facedetect.cpp opencv2.2 . ! persistence.cpp .

+2

All Articles