0
我想在Opencv2.4.4中使用VS2010express(C++)中的findContours函数代码如下。 Mat canny_output; std :: vector>轮廓;在opencv findContours与“System.AccessViolationException”
/// Detect edges using canny
Canny(src_gray, canny_output, 100, 200, 3);
/// Find contours
threshold(canny_output,canny_output,0,255,THRESH_BINARY);
findContours(canny_output, contours, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE);
但程序将总是在系统错误System.AccessViolationException的最后一行触发断点。
任何人有任何想法?
我已经定义的轮廓作为矢量<矢量>,后我删除阈值线,错误成为“堆被摧毁”,还有什么想法? –
2013-03-28 03:40:21
注释掉findContours并尝试imshow(“CANNY”,canny_output)...检查边缘检测后的图像。 – 2013-03-28 03:55:29
Canny后的图像可以正常输出,但它在findContours – 2013-03-28 04:13:34