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

ValueError: not enough values to unpack (expected 3, got 2) #1

Open
Goyapa opened this issue Mar 28, 2019 · 2 comments
Open

ValueError: not enough values to unpack (expected 3, got 2) #1

Goyapa opened this issue Mar 28, 2019 · 2 comments

Comments

@Goyapa
Copy link

Goyapa commented Mar 28, 2019

I tried this, but I got this error-message.
Can you give me some hints how to solve this?

micmac@lambda ~/prog-wiesn/rust-wiesn/ZoZo-Suit/python-version/Zozo-Measurer [16:12:31]

$ ls ⬡ 8.15.1 [±master ✓]
detect_points.py IMG_20180911_163153_c.jpg pycache
ellipse_helpers.py LICENSE README.md
env markers.py requirements.txt

micmac@lambda ~/prog-wiesn/rust-wiesn/ZoZo-Suit/python-version/Zozo-Measurer [16:21:40]

$ python3 -m venv env ⬡ 8.15.1 [±master ✓]
source env/bin/activate

micmac@lambda ~/prog-wiesn/rust-wiesn/ZoZo-Suit/python-version/Zozo-Measurer [16:22:11]
(env) > $ pip install -r requirements.txt ⬡ 8.15.1 [±master ✓]
Requirement already satisfied: numpy in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 1))
Requirement already satisfied: opencv-python in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied: pillow in ./env/lib/python3.6/site-packages (from -r requirements.txt (line 3))

micmac@lambda ~/prog-wiesn/rust-wiesn/ZoZo-Suit/python-version/Zozo-Measurer [16:22:25]
(env) > $ python3 detect_points.py IMG_20180911_163153_c.jpg
Traceback (most recent call last):
File "detect_points.py", line 64, in
point_ids, confidences, positions, distances, raw_data = detect_points(im)
File "detect_points.py", line 18, in detect_points
skewed_points, origins, ellipses = find_marker_ellipses(img)
File "/home/micmac/prog-wiesn/rust-wiesn/ZoZo-Suit/python-version/Zozo-Measurer/markers.py", line 76, in find_marker_ellipses
imgEdge, contours, hierarchy = findContours(th, RETR_TREE, CHAIN_APPROX_NONE)
ValueError: not enough values to unpack (expected 3, got 2)

micmac@lambda ~/prog-wiesn/rust-wiesn/ZoZo-Suit/python-version/Zozo-Measurer [16:22:55]
(env) > $ ⬡ 8.15.1 [±master ✓]

@Goyapa
Copy link
Author

Goyapa commented Mar 28, 2019

and cv2 is installed.

micmac@lambda ~/prog-wiesn/rust-wiesn/ZoZo-Suit/python-version/Zozo-Measurer [16:32:15]
(env) > $ python ⬡ 8.15.1 [±master ✓]
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import cv2
cv2.version
'4.0.0'

@pinae
Copy link
Owner

pinae commented Apr 4, 2019

OpenCV changed the interface of findContours(). It does not return an image anymore. Gladly my code doesn't use the returned image. Just remove imgEdge, in line 76 in https://github.com/pinae/Zozo-Measurer/blob/master/markers.py. Let me know if this solves your problem. I might update the code based on this to cv2 version 4.

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