opencv 3.0 findContours函数在窗口中不起作用

时间:2016-01-05 16:41:17

标签: c++ opencv

我正在使用visual studio 15并在opencv 3.0中工作,我的代码中出现访问冲突错误,甚至此函数也无法使用opencv中给出的示例代码。

doSearch

我正在使用x64架构并将所有库.lib与d.lib(调试库)链接在一起。

1 个答案:

答案 0 :(得分:0)

我认为问题来自你的&#34;轮廓&#34;变量。您将其声明为vector<cv::Mat>,但轮廓不是表示为矩阵,而是表示为一系列点。

请看这个例子:http://docs.opencv.org/2.4/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.html

他们将轮廓声明为vector<vector<Point> > contours;

另见函数声明(http://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?highlight=findcontours#findcontours),参数轮廓定义为:contours – Detected contours. Each contour is stored as a vector of points.

相关问题