pinae / Zozo-Measurer

Use the Zozo-Suit to measure yourself
GNU General Public License v3.0
32 stars 18 forks source link

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

Open Goyapa opened 5 years ago

Goyapa commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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.