akramhussein / pupil_plugin_marker_tracking_and_fixation_detection

A Pupil Plugin for Pupil Capture that detects ArUco Markers and identifies when one is being focused on.
GNU General Public License v3.0
1 stars 0 forks source link

[bug]cv2.findContours unpack error #1

Closed ZoomQuiet closed 6 years ago

ZoomQuiet commented 6 years ago

env.

error

Traceback (most recent call last):

  File "aruco_detector.py", line 231, in <module>
    detector(_pic)
  File "aruco_detector.py", line 189, in detector
    min_marker_perimeter=min_marker_perimeter
  File "/opt/data/uSEE/ETuSee/proto/test/M4ArUco/pupil_plugin_marker_tracking_and_fixation_detection/square_marker_detect_.py", line 161, in detect_markers
    , offset=(0,0)
ValueError: need more than 2 values to unpack

check

L157->square_markerdetect.py

see: Structural Analysis and Shape Descriptors — OpenCV 2.4.13.0 documentation

point example:samples/python2/contours.py

contours0, hierarchy = cv2.findContours( img.copy()
                                    , cv2.RETR_TREE
                                    , cv2.CHAIN_APPROX_SIMPLE
                                    )

suggest

i fix :

_img, contours, hierarchy = cv2.findContours(edges
    ...

as:

contours, hierarchy = cv2.findContours(edges
    ...

working now, guess usage old version?

akramhussein commented 6 years ago

Yes it's an old version.