MicrocontrollersAndMore / OpenCV_3_License_Plate_Recognition_Python

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

Brazilian Format License Plate #2

Open danielAlbuquerque opened 8 years ago

danielAlbuquerque commented 8 years ago

How can i read brazilian license plates? br_lbm-4000

JulianPedro commented 7 years ago

I also need help!!!

aaronmyhre commented 7 years ago

Hey guys, If you are still interested in this? I can take a look tonight if you are.

danielAlbuquerque commented 7 years ago

Yes! Off course :D

aaronmyhre commented 7 years ago

Kk I'll check it out. Need to get my other laptop with cv2.

I'm curious why it isn't working out of the box. I've reviewed the code pretty in-depth and there are no hard limits on the number of characters or dimensions / scale of the plate itself... maybe it could the be the dash beteeen the two sequences or maybe just the space itself..

Either way, I'm interested to see why this isn't working. Post some other pics if you would like me to look at hem as well.

On Mon, Apr 17, 2017 at 5:35 PM Daniel Albuquerque notifications@github.com wrote:

Yes! Off course :D

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/MicrocontrollersAndMore/OpenCV_3_License_Plate_Recognition_Python/issues/2#issuecomment-294636923, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtOuildrKSptR8fzZH4HdYW2E35Buh9ks5rxAVvgaJpZM4IbGBi .

JulianPedro commented 7 years ago

I'm sorry for the English, because I'm Brazilian, I gave an analysis and I think the script is not reading Brazilian car plates because the characters on the license plate are from a different source from North America.

Source Brazilian Plate: Mandatory

aaronmyhre commented 7 years ago

Can you give me any other examples of plates that aren't working besides the one on the issue?

The machine learning model that converts the contours to characters is trained on both letters and numbers and I don't think the characters are going to be too different on a Brazilian plate...

We will figure it out! On Mon, Apr 17, 2017 at 6:30 PM JulianPedro notifications@github.com wrote:

I'm sorry for the English, because I'm Brazilian, I gave an analysis and I think the script is not reading Brazilian car plates because the characters on the license plate are from a different source from North America.

Source Brazilian Plate: Mandatory

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MicrocontrollersAndMore/OpenCV_3_License_Plate_Recognition_Python/issues/2#issuecomment-294645418, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtOuvoCnvBqhntvzeEQl8CatgwuGIzJks5rxBI-gaJpZM4IbGBi .

aaronmyhre commented 7 years ago

Hey Guys -

It worked the first time, no changes.

Just make sure that the file path is correct in line 30 of main.py so it points to the location of your image.

screen shot 2017-04-17 at 9 13 04 pm
danielAlbuquerque commented 7 years ago

Hey Aaron, first of all thanks for helping us. What about the "M"? It should return "LBM4000"

aaronmyhre commented 7 years ago

Ah I didn't see that... let me look into it. The code has some really nice debug functionality that will show up if you change the debug flag in he main file. On Tue, Apr 18, 2017 at 7:15 AM Daniel Albuquerque notifications@github.com wrote:

Hey Aaron, first of all thanks for helping us. What about the "M"? It should return "LBM4000"

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MicrocontrollersAndMore/OpenCV_3_License_Plate_Recognition_Python/issues/2#issuecomment-294858446, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtOuudHCchyrkL-pzToK_mGrdtqQmenks5rxMWZgaJpZM4IbGBi .

aaronmyhre commented 7 years ago

Hey Guys -

Not sure what was going on before, but The "M" was coming through correctly when I tried again today....

  1. Upgraded from python 2 -> 3. My OpenCV install is bound with python 3, so I had to upgrade the project

    • ran 2to3 -n -W *.py in project directory
  2. pointed project to sample license plate

    • downloaded pic to LicPlateImages folder, named it braz.jpg
    • pointed main.py at file, updated line 30 to imgOriginalScene = cv2.imread("LicPlateImages/braz.jpg")

So at this point, I think its working... if you have other images that arnt, let me know. You can also git clone my forked repo that has the changes above: https://github.com/aaronmyhre/OpenCV_3_License_Plate_Recognition_Python

screen shot 2017-04-18 at 5 00 19 pm
JulianPedro commented 7 years ago

Friend I want to thank you both for the attention and kindness, for the tests done here are working, I will test more calmly afterwards and give you the feedback. Thank you so much!!!

aaronmyhre commented 7 years ago

Happy to help and thanks for the kind words! Let me know if I can do anything else! On Thu, Apr 20, 2017 at 3:56 PM JulianPedro notifications@github.com wrote:

Friend I want to thank you both for the attention and kindness, for the tests done here are working, I will test more calmly afterwards and give you the feedback. Thank you so much!!!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MicrocontrollersAndMore/OpenCV_3_License_Plate_Recognition_Python/issues/2#issuecomment-295954096, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtOupKX50cfOCQNscjku8Z46duoK7kdks5rx-KDgaJpZM4IbGBi .

JulianPedro commented 7 years ago

My friend, I tested again with other images, the problem is that some letters are still going incorrect, is there anything else you can do to help us? Thank you!

aaronmyhre commented 7 years ago

Are the letters missing, or are they being misidentified?

If they are being misidentified - There is probably something to do with the KNN machine learning model.... I don't think this is the issue.

If they are missing - This probably has something to do with the plate detection functionality. I would do a few things

  1. review how the solution works in by reading DocsAndPresentation/Steps with Images.pdf
  2. set showSteps in line 18 of Main.py to True so you can see the intermediate steps.
  3. walk through the steps and figure out where in the process the character is being dropped. It could be failing in various areas
    • Contour extraction: if the picture is too small, or lighting is bad the contour of the character might not be extracted
    • Character detection: there are lots of heuristics applied in DetectChars.py that try to determine if the contour extracted by cv2.findContours are "real" characters or just noise. These might be excluding the contour. These can be adjusted in lines 16 - 42

These are just some ideas of how I would debug the issue. Feel free to send me the pictures that aren't working and Ill take a look as well.

On Fri, Apr 21, 2017 at 7:30 AM, JulianPedro notifications@github.com wrote:

My friend, I tested again with other images, the problem is that some letters are still going incorrect, is there anything else you can do to help us? Thank you!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MicrocontrollersAndMore/OpenCV_3_License_Plate_Recognition_Python/issues/2#issuecomment-296206729, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtOutQaL-rUOTuIhCs1PfTCd9YOClv1ks5ryL2hgaJpZM4IbGBi .

grecointernet commented 6 years ago

Hey Guys This image and a camera, already installed and I can not do the recognition. I tested the openAlpr website and recognized. Does anyone have any ideas how to do it? link2

Thanks

aaronmyhre commented 6 years ago

I think the plate is too small and skewed. There are some parameters with the minimum size of a contour... check the detectchar file... On Fri, Jun 1, 2018 at 3:34 PM grecointernet notifications@github.com wrote:

Hey Guys This image and a camera, already installed and I can not do the recognition. I tested the openAlpr website and recognized. Does anyone have any ideas how to do it? [image: link2] https://user-images.githubusercontent.com/4303483/40866194-c2068e40-65d2-11e8-97d1-008897341366.jpg

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MicrocontrollersAndMore/OpenCV_3_License_Plate_Recognition_Python/issues/2#issuecomment-394026861, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtOuqDZ7bh6jtOFsNJ4BtoHlx3U40J6ks5t4cFzgaJpZM4IbGBi .

adkmmm commented 6 years ago

Hi @aaronmyhre, I cant seem to read my license plate in Singapore. I think it is because of the font being used. SIngapore followed the UK stlye. Is there a way to change the font ? singapore_1990_vehicle_registration_plate_of_a_silver_ford_focus

aaronmyhre commented 6 years ago

Ahh I don’t think that is the problem... this this a random idea but can you inverse the colors so the numbers are dark on a while license plate? The contour function might be expecting that... What results are you getting, nothing? On Sat, Jul 21, 2018 at 12:18 AM adkmmm notifications@github.com wrote:

Hi @aaronmyhre https://github.com/aaronmyhre, I cant seem to read read my license plate in Singapore. I think it is because of the font being used. SIngapore followed the UK stlye. Is there a way to change the font ? [image: singapore_1990_vehicle_registration_plate_of_a_silver_ford_focus] https://user-images.githubusercontent.com/34214590/43033211-bc00e8b8-8cf8-11e8-9e3c-41dcc5c15a4b.jpg

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/MicrocontrollersAndMore/OpenCV_3_License_Plate_Recognition_Python/issues/2#issuecomment-406776901, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtOujhTXYqWVIR-nt0ZmT9U0g0QxoH3ks5uItXdgaJpZM4IbGBi .

adkmmm commented 6 years ago

I think the previos image wasnt clear, it couldnt detect any car plate. I have tried it with another one, this is the result i got. image

hackeritchy commented 5 years ago

Change the background color of your plate from dark to white and your character from white to dark. Because, this is how the origin KNN model was trained. This is what I got using the above image after a little trick, you can further tune it to your need. image

I think the previos image wasnt clear, it couldnt detect any car plate. I have tried it with another one, this is the result i got. image