CascadeClassifier::load function always returns false
Hi. My CascadeClassifier::load function returns false even with an absolute path to the xml file :
face_cascade.load( "D:/tmp/haarcascade_frontalface_alt2.xml" );
I'm using opencv 2.4.5
your code works with vs2010 and opencv 2.4.5 ... Maybe your path isn't correct ?
Are you sure that you have correctly created your face_cascade object? Also make sure you have no typo's. I use this code daily and do not see an immediate problem. Maybe add your complete code?
If you are running in Windows, make sure that you are using slash () in the path. You are using the backslash (/), it is used in Linux environments.
This is the most common mistake made by people. It was only for windows95 and earlier versions, you actually had to watch the backslash or frontslash problem. So this is not the case anymore in more recent versions like windows 7. However, when using backslashes \ , I advice you to use doubles \, because the backslash is the windows escape character. To avoid this, use frontslash, which works perfectly.