error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32F || depth ==CV_32S

【解决】error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function ‘cv::contourArea’

In OpenCV 3.4:

    image, contours, hierarchy=  cv2.findContours(image, mode, method[, contours[, hierarchy[, offset]]]) 

修改为

In OpenCV 4.0:

contours, hierarchy= findContours(image, mode, method[, contours[, hierarchy[, offset]]]) 

你可能感兴趣的:(opencv)