Ask Your Question

isContourConvex error -215

asked 2014-07-18 04:53:51 -0600

thdrksdfthmn gravatar image thdrksdfthmn
755 1 18

I am doing a convexhull of a contour if it is not convex in a function:

PointVector Verification::convexingContour(const PointVector& contourIn)
    PointVector hullRet;

    if (cv::isContourConvex(contourIn))
        return contourIn;
        cv::convexHull(contourIn, hullRet);
        return hullRet;

I get the error of:

OpenCV Error: Assertion failed (contour.checkVector(2) >= 0 && (contour.depth() == CV_32F || contour.depth() == CV_32S)) in isContourConvex, file /home/me/opencv/modules/imgproc/src/contours.cpp, line 2010
unknown location(0): fatal error in "sol2": std::exception: /home/me/opencv/modules/imgproc/src/contours.cpp:2010: error: (-215) contour.checkVector(2) >= 0 && (contour.depth() == CV_32F || contour.depth() == CV_32S) in function isContourConvex

at runtime. The problem appears just for some contours, because I run the function on a set of images. What could be the problem? Is there a bug, because I have seen the same problem on VS2012, reported as problem?

delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-08-05 06:57:02 -0600

thdrksdfthmn gravatar image thdrksdfthmn
755 1 18

The problem seems to be the empty contours as parameter. I'll fix it with a flag/if sentence

link delete flag offensive edit

Login/Signup to Answer

Question tools


subscribe to rss feed


Asked: 2014-07-18 04:53:51 -0600

Seen: 83 times

Last updated: Aug 05