apoorva-dave / LicensePlateDetector

Detects license plate of car and recognizes its characters
345 stars 113 forks source link

when i run it with my car video of my country i see a error #5

Closed ldkhuong35 closed 5 years ago

ldkhuong35 commented 5 years ago

Traceback (most recent call last): File "PredictCharacters.py", line 1, in import SegmentCharacters File "E:\License\LicensePlateDetector-master\SegmentCharacters.py", line 11, in license_plate = np.invert(DetectPlate.plate_like_objects[0]) IndexError: list index out of range

What is the content of DetectPlate.plate_like_objects[]? and how to fix issues? Can you tell me how to recognize license plate with two line characters in the license plate?

sam-d007 commented 5 years ago

Hey Apoorva, how should I run it on an image? It is giving the above errors, I tried changing the path to the image but it didn't work. Where should i make changes?

apoorva-dave commented 5 years ago

@ldkhuong35 plate_like_objects is a list that contains the objects which it finds similar to license plates. The list is empty if it is unable to find any plate looking object and so it is throwing an error. You can try with different image or test dataset in the repo. This code assumes there is only one car in the image with a clear license plate. I haven't tested for 2 line characters. However, I beileve you can use similar approach CCA for detecting characters as it identifies dense regions.

apoorva-dave commented 5 years ago

@sam-d007 you just need to change the input file. For a video, we are taking different frames. For an image, it would be straightforward. You can read a car image as a grayscale image in DetectPlate.py rest of the code will remain same. Try using the test image in repo.

sam-d007 commented 5 years ago

@apoorva-dave Thanks, it worked. Do you know of any model that is trained on Indian License Plates? I found a haar cascade for Russian plates but not for Indian plates.

apoorva-dave commented 5 years ago

@sam-d007 Not that I aware of. But these links might be helpful for you - https://www.kaggle.com/questions-and-answers/50622 https://towardsdatascience.com/number-plate-detection-with-supervisely-and-tensorflow-part-1-e84c74d4382c

girijesh18 commented 5 years ago

Hi, @apoorva-dave I am trying to detect licence plate number using your code and it is working like a charm for videos but I am facing some issue while detecting number from an image. In DetectPlate.py I am trying to pass the image path in this line car_image = imread("./car6.jpg", as_gray=True) . But after this, I am getting the following error.

LicensePlateDetector-master\SegmentCharacters.py", line 10, in <module> license_plate = np.invert(DetectPlate.plate_like_objects[0]) IndexError: list index out of range

I tried to rectify by checking other files but no luck yet. Any help would be highly appreciated.