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.
source
share