mpatacchiola/deepgaze

contours, hierarchy = cv2.findContours(mask, 1, 2) ValueError: too many values to unpack (expected 2)

SolomonAvion opened this issue · 2 comments

am trying to test this example and i got this error

Traceback (most recent call last):
File "ex_particle_filter_object_tracking_video.py", line 70, in
if(my_mask_analyser.returnNumberOfContours(frame_mask) > 0):
File "/usr/local/lib/python3.6/dist-packages/deepgaze/mask_analysis.py", line 36, in returnNumberOfContours
contours, hierarchy = cv2.findContours(mask, 1, 2)
ValueError: too many values to unpack (expected 2)
please how can i resolve this error

Hi @SolomonAvion please report the version of python, OpenCV, and deepgaze that you are using.
This is most likely a compatibility problem.

If you have a recent version of OpenCV it is possible that it is not compatible with deepgaze 1.0 and you have to install deepgaze 2.0 as reported in the README.

thanks, i have resolved it by adding a third value in front of the other two solved the problem for me
like this
_,contours, hierarchy = cv2.findContours(mask, 1, 2)