Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Heap-Error with findContours

When I try function findContours() I get the Run-Error: "Debug Assertion Failed! ... File:f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c Line:1322 ... Expression:_CrtIsValidHeapPointer(pUserData) ..."

My Code is very simple:

src = imread("D:/A1/auto5.jpg", 1 ); cvtColor( src, src_gray, COLOR_BGR2GRAY ); blur( src_gray, src_gray, Size(3,3) ); Mat canny_output; vector<vector<point> > contours; vector<vec4i> hierarchy; Canny( src_gray, canny_output, thresh, thresh2, 3 ); findContours( canny_output, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(0, 0) );

I'am using MS Visual Studio 2012

Any ideas?

click to hide/show revision 2
No.2 Revision

updated 2013-05-15 12:39:03 -0500

berak gravatar image

Heap-Error with findContours

When I try function findContours() I get the Run-Error: "Debug Assertion Failed! ... File:f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c Line:1322 ... Expression:_CrtIsValidHeapPointer(pUserData) ..."

My Code is very simple:

 src = imread("D:/A1/auto5.jpg", 1 );
  cvtColor( src, src_gray, COLOR_BGR2GRAY );
  blur( src_gray, src_gray, Size(3,3) );
  Mat canny_output;
  vector<vector<point> vector<vector<Point> > contours;
  vector<vec4i> vector<Vec4i> hierarchy;
  Canny( src_gray, canny_output, thresh, thresh2, thresh*2, 3 );
  findContours( canny_output, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(0, 0) );

);*

I'am using MS Visual Studio 2012

Any ideas?