Unhandled exception in Visual studio 2012 opencv

163 views Asked by At

I configured Opencv 2.4.13 in my visual studio 2012. I used the pre-compiled version of opencv, so I didn't compile nothing. By the way, I setted everything ( I followed tutorial in internet) and my simple programs (such as "show an image") work well. So my OpenCv are installed and they are working. Now, I try to execute this simple program: I read a video and then i take first frame and use SIFT detector and descriptor on it. My visual studio stops to work when I arrive in SIFT detector line. This is my code:

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/nonfree/features2d.hpp> // SIFT
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
#include <string>
#include <iomanip>
#include <stdlib.h>
#include "Histogram.hpp"
#include "Util.hpp"

using namespace std;
using namespace cv;

int main()
{
    VideoCapture video;
    Mat frame;
    int i = 0;
    SiftFeatureDetector siftDetector;
    SiftDescriptorExtractor siftDescriptor;
    vector<KeyPoint> siftKeypoints;

    FileStorage fs("keypointDescriptors.yml", FileStorage::WRITE);
    string frameName = "";
    string frameStringNumber;

    ostringstream convert;
    Mat_<float> descriptors;

    // Apro il video
    try {
        video.open("person15_walking_d1_uncomp.avi");
    }
    catch (Exception ex) {
        cout << ex.msg;
        return -1;
    }

    video.read(frame);
    siftDetector.detect(frame, siftKeypoints);
    siftDescriptor.compute(frame, siftKeypoints, descriptors);
    waitKey(0);

    return 0;
}

The error is:

Unhandled exception in 0x0085370A (opencv_imgproc2413d.dll) in ConsoleApplication4.exe: 0xC000001D: Illegal Instruction.
0

There are 0 answers