Ask Your Question

Revision history [back]

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 siple 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();" befor 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/objdetect/cascade_classifier/cascade_classifier.html

click to hide/show revision 2
No.2 Revision

updated 2015-02-08 08:45:30 -0500

berak gravatar image

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 siple 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();" befor 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/objdetect/cascade_classifier/cascade_classifier.html

click to hide/show revision 3
No.3 Revision

updated 2015-02-08 08:46:55 -0500

berak gravatar image

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 siple 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();" befor 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/objdetect/cascade_classifier/cascade_classifier.html

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/objdetect/cascade_classifier/cascade_classifier.html

in another machine by the way everything works fine, so it's not the code error. both the machines have x64 win7. any idea?