I am trying to do a simple area calculation of contours I get from findContours. My openCv version is 3.1.0
My code is:
cc = cv2.findContours(im_bw.c
This problem is caused by the different return value of cv2.findContours in different OpenCV versions.
In OpenCV 4.0.0, this error may looks like cv2.error: OpenCV(4.0.0) C:\projects\opencv-python\opencv\modules\imgproc\src\convhull.cpp:137: error: (-215:Assertion failed) total >= 0 && (depth == CV_32F || depth == CV_32S) in function 'cv::convexHull'
You can find a detailed explanation and solutions here: How to use `cv2.findContours` in different OpenCV versions?