Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

验证码切割报错 #1

Open
yanwii opened this issue Jan 24, 2019 · 1 comment
Open

验证码切割报错 #1

yanwii opened this issue Jan 24, 2019 · 1 comment

Comments

@yanwii
Copy link

yanwii commented Jan 24, 2019

环境:
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'
@Forever22
Copy link

出错上面的一行代码
contours = contours[0] if imutils.is_cv2() else contours[1]
改成
contours = contours[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants