2.4.10 CascadeClassifier Unhandled exception. Access violation writing location.
I have an exception "Unhandled exception at 0x0F633BD9 (opencv_core2410d.dll) in EyeHelper.exe: 0xC0000005: Access violation writing location 0x00000014." when i try to add simple piece of code "CascadeClassifier faceCascade;" here:
Rect getFaceCoords(Mat& frame, int algorithm)
{
Rect faceBox;
// add here:
// CascadeClassifier faceCascade;
switch (algorithm)
{
//HAAR CASCADE
case 1:
faceBox = Rect(20, 20, 20, 20);
break;
case 2:
break;
default:
break;
}
return faceBox;
}
Without CascadeClassifier everything works fine.
Exception occurs AFTER RETURN the method! i made simple bool or void function and create CascadeClassifier faceCascade there, it works, faceCascade.detectMultiScale also can find faces, but when the method is over, and it goes to return - exception. i have no idea what to do, i tried faceCascade.~CascadeClassifier();
before return, but it doesn't work as expected.
What could be the reason of exception, how to fix it (or how can i use Haar Cascade in other way)?
I'm working in VS2013, use MFC project. in project properties i have: platform toolset "Visual Studio 2013 (v120)" AdditionalLibraryDirectories $(OPENCV_BUILD)\x86\vc12\lib\; use opencv2. all AdditionalDependencies (libs) are like "opencv_core2410d.lib" (all with "d").
i'm working according to this example: http://docs.opencv.org/doc/tutorials/...
in another machine by the way everything works fine, so it's not the code error. both the machines have x64 win7. any idea?
what do you mean "real"? i'm trying to do something. i know that destructor is bad idea, without it also exception. i know that d means debug mode, i noticed it becouse i could be the reason (using release version in debug).
ALSO. in another machine by the way everything works fine, so it's not the code error. both the machines have x64 win7. any idea?