Wiki | Community | Discussion Forum | Q&A

Problem with cv2.findContours

Hello

I’ve another problem with cv2 API when execute it on Unibotics framework.
Specifically, the line:
“contours, hierarchy = cv2.findContours(mask, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)”
shows this error on the console:
“too many values to unpack”

Could anybody help me?

Thanks

Hi, try calling the function like this => _, contours, hierarchy = cv2.findContours (mask, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE). Receiving three arguments.

I think this is because RADI uses version 3.2.0 of openCV (https://docs.opencv.org/3.2.0/d4/d73/tutorial_py_contours_begin.html).

Thanks for your help.

However, the problem persists when I make this change in my code.