Ask Your Question

homes's profile - activity

2020-02-09 12:23:40 -0600 received badge  Notable Question (source)
2019-06-12 02:41:23 -0600 received badge  Popular Question (source)
2018-03-23 05:32:44 -0600 marked best answer drawContours throws exception

Hello, I use opencv3.3.1 from ros-kinetic When executing this code

            vector <vector <Point2i> > testContour;
            vector <Point2i> testedge;
            testedge.push_back(Point2i(240,240));
            testedge.push_back(Point2i(120,240));
            testedge.push_back(Point2i(120,120));
            testedge.push_back(Point2i(240,120));
            testContour.push_back(testedge);
            vector <Point2i> testedge2;
            testedge2.push_back(Point2i(200,200));
            testedge2.push_back(Point2i(100,200));
            testedge2.push_back(Point2i(100,100));
            testedge2.push_back(Point2i(200,100));
            testContour.push_back(testedge2);
    drawContours(image, testContour, -1,/*it->getColor()*/Scalar(255,255,255),CV_FILLED,LINE_8);

i get the following error:

OpenCV Error: Assertion failed (reader.ptr != __null) in cvDrawContours, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/imgproc/src/drawing.cpp, line 2603 terminate called after throwing an instance of 'cv::Exception' what(): /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/imgproc/src/drawing.cpp:2603: error: (-215) reader.ptr != __null in function cvDrawContours

now this only happens after updating the ros packages... before it ran fine.....

now i don't understand why exactly the reader.ptr() is __null, since my counturs vector is filled as u can see above, also google is quite emoty of that problem.

best regards, homes

edit: it works now with the testContour, but it doesn't appear to work with a dynamically filled Contour vector. Am I correct in my assumption, that this means i am trying to pass a undefined pointer to the drawContours function?

2018-03-23 03:44:27 -0600 answered a question drawContours throws exception

So I found the reason for my error or at least an workarround. It is possible to pass a vector<vector<point>>

2017-12-14 08:22:51 -0600 commented question drawContours throws exception

yep, that was one problem, but edgeVector is a dynamic generated vector<vector<point2i> > , it may be possib

2017-12-14 07:43:29 -0600 commented question drawContours throws exception

yep, that was one problem, but edgeVector is a dynamic generated vector<vector<point2i> > , it may be possib

2017-12-14 07:32:48 -0600 received badge  Editor (source)
2017-12-14 07:32:48 -0600 edited question drawContours throws exception

drawContours throws exception Hello, I use opencv3.3.1 from ros-kinetic When executing this code vector &

2017-12-14 07:05:18 -0600 asked a question drawContours throws exception

drawContours throws exception Hello, I use opencv3.3.1 from ros-kinetic When executing this code vector &