The code below is giving me the following error when running in Visual Studio 2010: Run-Time Check Failure #2 - Stack around the variable 'keypoints' was corrupted.
#include<iostream>
#include<fstream>
#include<cv.h>
#include<highgui.h>
#include<opencv2/nonfree/features2d.hpp>
using namespace std;
using namespace cv;
int main(int argc, char *argv[])
{
Mat image = imread("C:/IMAGE.JPG");
SiftFeatureDetector detector;
vector<KeyPoint> keypoints;
detector.detect(image, keypoints);
return 0;
}
Any idea what what I’m doing wrong?
Turns out I needed to compile
OpenCVlibrary using Visual Studio 2010 rather than just linking to precompileddlls and such. All is well now.