Ask Your Question
0

isContourConvex error -215

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

thdrksdfthmn gravatar image

updated 2020-10-23 09:54:29 -0600

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

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

thdrksdfthmn gravatar image

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

edit flag offensive delete link more

Question Tools

Stats

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

Seen: 3,765 times

Last updated: Aug 05 '14