MicrocontrollersAndMore / OpenCV_3_License_Plate_Recognition_Python

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

ValueError: too many values to unpack (expected 2) #25

Closed thomas4721 closed 3 years ago

thomas4721 commented 4 years ago

i'm trying using your code and watch your video from start to the end. but i got this problem when running it. any solution for this problem?

this what an error said: File "C:\Users\ASUS\Documents\Spyder\aa\DetectPlates.py", line 133, in findPossibleCharsInScene contours, npaHierarchy = cv2.findContours(imgThreshCopy, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) # find all contours

ValueError: too many values to unpack (expected 2)

slowrunner commented 4 years ago

https://stackoverflow.com/a/56142875/2367230 recommends adding [-2:] to the end of the findContours() I added it in DetectPlates.py line 138, and DetectChars.py line 239, and it worked! (python3 Main.py)