MicrocontrollersAndMore / OpenCV_3_License_Plate_Recognition_Python

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

Facing Errors Mian.py #17

Open nomanbahoo opened 5 years ago

nomanbahoo commented 5 years ago

main() listOfPossiblePlates = DetectPlates.detectPlatesInScene(imgOriginalScene) # detect plates listOfPossibleCharsInScene = findPossibleCharsInScene(imgThreshScene) imgContours, contours, hierarchy = cv2.findContours(imgThreshCopy, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) # find all contours ValueError: not enough values to unpack (expected 3, got 2) Capture

RYucel commented 5 years ago

Same Error I got too

RYucel commented 5 years ago

Change these lines in detectPlate.py Line no: 133-----

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

detectChars.py Line no: 239-----

 contours, npaHierarchy = cv2.findContours(imgThreshCopy, cv2.RETR_CCOMP, 
 cv2.CHAIN_APPROX_SIMPLE)

for contour in contours:                        # for each contour
    possibleChar = PossibleChar.PossibleChar(contour)
nomanbahoo commented 5 years ago

thanks sir its working for me ... i really appreciate you ...kindly you can tell me how can i use this project for Pakistani car number plates ?????

AthiraAsakumar commented 5 years ago

I had same errors but after changing the above mentioned lines code worked. Thank you so much . Its my MCA project .

slowrunner commented 4 years ago

Interesting, neither change worked for me in Python3, but the adding [-2:] at the end of the original findContours() worked.