Ask Your Question
0

isContourConvex error -215

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

thdrksdfthmn gravatar image thdrksdfthmn
635 1 17

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;
    }
    else
    {
        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
0

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

thdrksdfthmn gravatar image thdrksdfthmn
635 1 17

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

Follow

subscribe to rss feed

Stats

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

Seen: 62 times

Last updated: Aug 05