MicrocontrollersAndMore / OpenCV_3_License_Plate_Recognition_Python

https://www.youtube.com/watch?v=fJcl6Gw1D8k
525 stars 317 forks source link

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

Closed ali97hz closed 5 years ago

ali97hz commented 5 years ago

hello

I just run it and get this error I saw somebody else got the same error

DetectPlates.py", line 133, in findPossibleCharsInScene imgContours, contours, npaHierarchy = cv2.findContours(imgThreshCopy, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) # find all contours ValueError: not enough values to unpack (expected 3, got 2)

can anybody help me with this?

ghost commented 5 years ago

the function cv2.findContours() has been changed to return only the contours and the hierarchy and not ret

you should change it to:

contours,hierachy=cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)