MicrocontrollersAndMore / OpenCV_3_License_Plate_Recognition_Python

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

value error #18

Open Shubham191297 opened 5 years ago

Shubham191297 commented 5 years ago

File "C:\Users\Shubham.000\Desktop\OpenCV_3_License_Plate_Recognition_Python-master\DetectPlates.py", line 133, in findPossibleCharsInScene imgContours, contours, npaHierarchy = cv2.findContours(imgThreshCopy, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) # find all contours

ValueError: need more than 2 values to unpack

pristis commented 4 years ago

Same issue here.

python Main.py Traceback (most recent call last): File "Main.py", line 134, in <module> main() File "Main.py", line 38, in main listOfPossiblePlates = DetectPlates.detectPlatesInScene(imgOriginalScene) # detect plates File "/home/martin/Documents/Plate/OpenCV_3_License_Plate_Recognition_Python-master/DetectPlates.py", line 43, in detectPlatesInScene listOfPossibleCharsInScene = findPossibleCharsInScene(imgThreshScene) File "/home/martin/Documents/Plate/OpenCV_3_License_Plate_Recognition_Python-master/DetectPlates.py", line 133, in findPossibleCharsInScene imgContours, contours, npaHierarchy = cv2.findContours(imgThreshCopy, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) # find all contours ValueError: need more than 2 values to unpack

techieph commented 4 years ago

the function cv2.findContours() has been changed to return only the two parameters, here in this context contours, npaHierarchy you should change it to: contours, npaHierarchy = cv2.findContours(imgThreshCopy, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) # find all contours in Line:133 in DetectPlates.py, contours, npaHierarchy = cv2.findContours(imgThreshCopy, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE) in Line:239 in DetectPlates.py. Ping me back if it works!

Mayank2504 commented 4 years ago

@techieph yes it worked

iNusz commented 4 years ago

@techieph it works well!!

but in 7 line you should change word DetectPlates.py -> DetectChars.py