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

too many values to unpack #118

Open
kdiogenes opened this issue May 3, 2018 · 3 comments
Open

too many values to unpack #118

kdiogenes opened this issue May 3, 2018 · 3 comments

Comments

@kdiogenes
Copy link

kdiogenes commented May 3, 2018

I'm getting this error when trying to run the script https://github.com/danvk/oldnyc/blob/master/ocr/tess/crop_morphology.py:

$: ./crop_morphology.py untitled.jpg
untitled.jpg too many values to unpack

Any hint of what can be the issue?

@ecit241
Copy link

ecit241 commented May 4, 2018

the same problem to u

@kdiogenes
Copy link
Author

kdiogenes commented May 4, 2018

I find that the problem is in the call cv2.findContours. Maybe the script uses opencv2, from my distro repos I only find opencv3, but I have not had time to read the documentation.

@juliomax
Copy link

in older versions cv2.findContours return 2 values
in new versions of opencv, this funcion return 3 values, so you have to update the code to receive these 3 values:
Ex:
from contours, hierarchy = cv2.findContours
to something like this:
_, contours, hierarchy = cv2.findContours

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

3 participants