我使用的是OpenCv 2.49和VS2010专业版
当我使用OpenCV示例中几乎相同的代码时,findcontours函数会导致堆损坏。
findContours(Mask, contours, CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, Point(0, 0) );
for( int i = 0; i< contours.size(); i++ )
{
Scalar color( rand()&255, rand()&255, rand()&255 );
drawContours( *pImg, contours, i, color, 2, 8, hierarchy, 0, Point());
}
并检查输入图像类型,它不是8UC1而不是空的 我想这是因为环境设置。
但我无法弄清楚错误是如何来自
在解决方案 - &gt;属性中 其他包含目录是
C:\ opencv249 \的OpenCV \建立\包括
运行时库是
多线程调试(/ MTd)
在“链接器”选项卡中,其他库目录为
C:\ opencv249 \的OpenCV \建立\ 86 \ VC10 \ lib中
输入依赖项
opencv_calib3d249d.lib
opencv_contrib249d.lib
opencv_core249d.lib
opencv_features2d249d.lib
opencv_flann249d.lib
Kinect10.lib
opencv_gpu249d.lib
opencv_highgui249d.lib
opencv_imgproc249d.lib
opencv_legacy249d.lib
opencv_ml249d.lib
opencv_nonfree249d.lib
opencv_objdetect249d.lib
opencv_ocl249d.lib
opencv_photo249d.lib
opencv_stitching249d.lib
opencv_superres249d.lib
opencv_ts249d.lib
opencv_video249d.lib
opencv_videostab249d.lib
comctl32.lib
有人可以帮忙吗?谢谢