I just installed OpenCV 2.2 and Visual C ++ 2010 and configured it. I do not get compilation errors, but I run this code. I get this error.
Unhandled exception at 0x6c2f22f2 (msvcr100.dll) in Es_CornerDetector.exe: 0xC0000005: access violation reading location 0x002a1000.
code:
#include "opencv/highgui.h" #include "opencv2/features2d/features2d.hpp" int main(int argc, char** argv) { cv::SurfFeatureDetector detector; detector.create("SURF"); }
I really don’t understand what could be the reason.
Update:
Using the "detector.create ()" function may be wrong, so I tried something else, but I got another error (always when I try to access the "detector"):
First-chance exception at 0x67608ef4 in Es_CornerDetector.exe: 0xC0000005: Access violation writing location 0x02655008. Unhandled exception at 0x67608ef4 in Es_CornerDetector.exe: 0xC0000005: Access violation writing location 0x02655008.
Alternative code:
#include "opencv\cv.h" #include "opencv\highgui.h" #include "opencv2\features2d\features2d.hpp" #include <vector> #include <iostream> int main() { IplImage* img_temp = cvLoadImage("img.jpg"); cv::Mat img(img_temp); if(img.empty()==1) { std::cout << "Can't load the image.." << endl; getchar(); return -1; } cv::SurfFeatureDetector detector; vector<cv::KeyPoint> keypoints; detector.detect(img,keypoints); return 0; }
Update 2
I get the same error on two different systems with both VS2010 and VS2008, and also, if I try to run the descriptor_extractor_matcher.cpp code example, which can be found in. \ OpenCV2.2 \ samples \ cpp \ descriptor_extractor_matcher.cpp
attempted OpenCV 2.3.1 (both binary and compiled):
Wow, new exotic bug:
Run-Time Check Failure
I'm going to give up ...
source share