Open Shubham191297 opened 5 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
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!
@techieph yes it worked
@techieph it works well!!
but in 7 line you should change word DetectPlates.py -> DetectChars.py
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