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

最近学习唐宇迪ocr识别项目

cnts = cv2.findContours(edged.copy(), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)[1]
cnts = sorted(cnts, key = cv2.contourArea, reverse = True)[:5]

运行到这段代码报以上的错误
改为

cnts, hierarchy= cv2.findContours(edged.copy(), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)

解决问题

猜你喜欢

转载自blog.csdn.net/Meloneating/article/details/115083984