Open yanwii opened 5 years ago
环境: opencv-python 4.0.0.21
opencv-python 4.0.0.21
错误为:
Traceback (most recent call last): File "captcha_generator.py", line 188, in <module> letter_image_regions = extract(image, str=captcha_correct_text) File "captcha_generator.py", line 79, in extract (x, y, w, h) = cv2.boundingRect(contour) cv2.error: OpenCV(4.0.0) /io/opencv/modules/imgproc/src/shapedescr.cpp:741: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'pointSetBoundingRect'
出错上面的一行代码 contours = contours[0] if imutils.is_cv2() else contours[1] 改成 contours = contours[0]
环境:
opencv-python 4.0.0.21
错误为: