转义范围后,我得到了损坏的堆错误消息。调试断言在debug_heap.cpp在_CrtlsValidHeapPointer(块)失败堆已损坏opencv
#include "opencv2\opencv.hpp"
#include "opencv2\nonfree\features2d.hpp"
using namespace cv;
int main(int argc, char* argv[]) {
Mat img = imread(argv[1]);
SurfFeatureDetector detector(400);
vector<KeyPoint> keypoints;
detector.detect(img, keypoints);
return 0;
}
EDIT 固定。问题在于链接。我使用了visual studio 2015和opencv 2.49 x86 vc10。 vc10适用于visual studio 2010.在visual studio 2010中运行一些程序并且工作得很好。
为什么不在这里提交新问题https://github.com/Itseez/opencv/issues?顺便说一句,你应该检查img.data为非空,因为imread可能会失败。 –
执行错误检查,并使用调试器 – Drop
@SergeiNikulov为什么这个新生会打扰高度专业的OpenCV程序员团队?他的代码中有99.99%的机会出现错误。 – Drop