Deevoluation / ALPR

Automatic License Plate Recognition
156 stars 62 forks source link

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

Closed suhas-goutham closed 5 years ago

suhas-goutham commented 5 years ago

imgContours, contours, npaHierarchy = cv2.findContours(imgThreshCopy, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE) # find all contours

Saqhas commented 5 years ago

which file did you run

suhas-goutham commented 5 years ago

Start.py

suhas-goutham commented 5 years ago

So basically the issue is in In openCV4, cv2.findContours() returns 2 values contours, hierarchy, so it should be: contours, hierarchy = cv2.findContours(edged, cv2.RETR_LIST, cv2.CHAIN_APPROX_NONE)

So in file DetectPlates.py line 134 should be changed to contours, npaHierarchy = cv2.findContours(imgThreshCopy, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE) # find all contours

And in file DetectChars.py line 215 should be changed to contours, npaHierarchy = cv2.findContours(imgThreshCopy, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)

Then it works

thebigshaikh commented 4 years ago

@suhas201227 I am facing the same issue. How did you resolve it? By implementing the steps above?

Saqhas commented 4 years ago

This repo is made with opencv 3. Please us that only. If you want it to work with opencv4 then you will need to change the code as specified by @suhas201227