Ask Your Question

Trigary's profile - activity

2017-01-10 15:34:43 -0600 answered a question I have problem with function Find Contours! what could be the problem?

I suspect I have a similar problem, but unfortunately it seems like I can't solve it.

Mat test = Mat (2, 2, CV_8UC3, Scalar (255, 255, 255)); //Only for debug
Mat gray;
cvtColor (test, gray, CV_BGR2GRAY);
Mat bin;
threshold (gray, bin, 100, 255, THRESH_BINARY);
vector<vector<Point> > contours;
findContours (bin, contours, CV_RETR_LIST, CV_CHAIN_APPROX_NONE, Point (0, 0));

When I call the findContours method, I get an error: "Unhandled exception at 0x76947FB2 (ucrtbase.dll) in ProjectName.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.", the debug jumps to matrix.cpp, line 2614: CV_ERROR(..., "Unkown/unsupported array type"). While I was testing I also got the error message shown in the question above, but I do not know the circustances of that anymore. I am using VS2015 and I have compiled OpenCV for myself. The computer is an x64 one, but the visual studio project is set to x86 and I have compiled OpenCV for x86. All OpenCV files (DLLs, LIBs) are from the (build/)install folder, so I'm not mixing release and debug ones. Setting the project to "/MDd" did not help.

Do you have any other recommendations?