Training for Philippine license plate

778 views
Skip to first unread message

Daniel John Gomez

unread,
Jun 7, 2015, 9:44:10 AM6/7/15
to open...@googlegroups.com

Good day, I want to train openALPR to recognize philippine license plate but wondering if i need to train it. Also, the plate is different for cars(3 letters, 4 numbers) and motorcycles(2 letters, 5 numbers).


I've noticed that openalpr provides 2 training repositories, the train-ocr and train-detector. If i need to train it, what should i use and do? Thanks for your help, I'm a student hoping to do this project for my community thanks. 


Here are the samples:




Matt

unread,
Jun 7, 2015, 1:29:50 PM6/7/15
to open...@googlegroups.com, djgo...@gmail.com
You could probably get pretty good accuracy with a hodge-podge of the existing training data, rather than doing a full retrain for Philippines.  

For example, when I run ALPR against this plate (https://c2.staticflickr.com/6/5486/14248952977_ae571ddd05_b.jpg) using US, EU, and AU, these are the results I get:

[mhill@mhill-linux tmp]$ alpr -c au 14248952977_ae571ddd05_b.jpg 
plate0: 10 results
    - AAJG5G8 confidence: 83.9827
    - AAJG588 confidence: 81.0565
    - AAJG5GS confidence: 78.3713
    - AAJG5S8 confidence: 77.4648
    - AAJG5G confidence: 77.0375
    - AAJG58 confidence: 75.5579
    - AAJG58S confidence: 75.4451
    - AAJG58 confidence: 74.1113
    - AAJG5SS confidence: 71.8534
    - AAJG5S confidence: 70.5196
[mhill@mhill-linux tmp]$ alpr -c us 14248952977_ae571ddd05_b.jpg 
plate0: 10 results
    - AAJ6589 confidence: 88.2165
    - AAJG589 confidence: 85.1765
    - AAJ65G9 confidence: 84.962
    - AAJ8589 confidence: 84.2359
    - AAJS589 confidence: 83.5574
    - AAJB589 confidence: 83.0178
    - AAJG5G9 confidence: 81.9219
    - AAJ85G9 confidence: 80.9814
    - AAJ589 confidence: 80.8672
    - AAJS5G9 confidence: 80.3029
[mhill@mhill-linux tmp]$ alpr -c eu 14248952977_ae571ddd05_b.jpg 
plate0: 10 results
    - AAJ6569 confidence: 90.4232
    - AAJG569 confidence: 83.1283
    - AAJ65G9 confidence: 82.8295
    - AAJS569 confidence: 81.9119
    - AAJB569 confidence: 81.6607
    - AAJ569 confidence: 77.6361
    - AAJG5G9 confidence: 75.5346
    - AAJS5G9 confidence: 74.3181
    - AAJB5G9 confidence: 74.0669
    - AAJ5G9 confidence: 70.0424

You could add a new country for Phillipines and use the Australia plate detector (the plate dimensions are closest to Australia) and the EU OCR font.  Then just tweak the config parameters for accuracy.  Make sure you add a pattern for Phillipines (@@@####) since that will significantly increase accuracy.

-Matt

Daniel John Gomez

unread,
Jun 8, 2015, 5:40:25 AM6/8/15
to open...@googlegroups.com, djgo...@gmail.com
Hi Matt,

Thanks for the awesome tip! 

I've copied some configs from AU and EU, and made a pattern. I just want to know if it's normal that the highest confidence is not following the pattern(@@@####) though I get a pattern match:

openalpr>alpr -c ph -p ph ../test.jpg
plate0: 10 results
    - AAJ65G9    confidence: 90.752      pattern_match: 0
    - AAJ6569    confidence: 88.8506     pattern_match: 1
    - AAJG5G9    confidence: 87.3747     pattern_match: 0
    - AAJG569    confidence: 85.4733     pattern_match: 0
    - AAJS5G9    confidence: 83.6298     pattern_match: 0
    - AAJB5G9    confidence: 83.5936     pattern_match: 0
    - AAJS569    confidence: 81.7283     pattern_match: 0
    - AAJB569    confidence: 81.6921     pattern_match: 0
    - AAJC5G9    confidence: 80.4074     pattern_match: 0
    - AAJC569    confidence: 78.5059     pattern_match: 0

Here are the things I've done:
1. I copied the contents of au.conf to openalpr.conf and runtime_data/config/ph.conf
2. Made lph.traineddata by using leu.traineddata content
3. Made ph.patterns with "ph @@@####" as the pattern
4. Made ph.xml by using eu.xml contents

Thanks again!

Matt

unread,
Jun 12, 2015, 9:11:33 AM6/12/15
to open...@googlegroups.com, djgo...@gmail.com
Yes, that's normal.  The results will always show every possibility.  When you parse them, just iterate through each result and pick the one that matches the pattern.  If you ever do anything more advanced advanced (e.g., weighting results across image frames) you may end up choosing a result that doesn't match the pattern.

Alexandre Coste

unread,
Aug 2, 2015, 11:47:34 AM8/2/15
to OpenALPR, djgo...@gmail.com
Hi Daniel and Matt,

Regarding the fonts used in the new Philippines plate, i m confusing to know what type it is ? look like a shake of several fonts.
Is it necessary to train Tesseract-ocr with this fonts to have better acurracy ?

Thanks for your help
Best regards
Alexander

Matt

unread,
Aug 4, 2015, 10:42:28 PM8/4/15
to OpenALPR, djgo...@gmail.com, coste.a...@gmail.com
Yes, you'll keep the character images separate for each font.  When doing the training, they'll all roll into the Philippines OCR trained data.

Alexandre Coste

unread,
Aug 5, 2015, 4:41:05 AM8/5/15
to Matt, OpenALPR, djgo...@gmail.com
Hi Matt,

Thanks for the answer :) Will work on it now.

I have seen in /usr/local/share/openalpr/runtime_data/keypoints/us that it has all background of pate of US states.
What is used for ?
Is it usefull i put background of Philippines plate ?

Thanks for your lights.

Alexander

Matt

unread,
Aug 5, 2015, 9:25:16 AM8/5/15
to OpenALPR, matt...@gmail.com, djgo...@gmail.com
Those images are just used for an experimental feature that detects regions (e.g., Maryland versus California).  The accuracy never got above 50-60%, so I will likely remove it and try another approach that will likely be much more accurate.


On Wednesday, August 5, 2015 at 4:41:05 AM UTC-4, Alexandre Coste wrote:
Hi Matt,

Thanks for the answer :) Will work on it now.

I have seen in /usr/local/share/openalpr/runtime_data/keypoints/us that it has all background of pate of US states.
What is used for ?
Is it usefull i put background of Philippines plate ?

Thanks for your lights.

Alexander

Mikael Arhelger

unread,
Aug 6, 2015, 9:56:04 AM8/6/15
to OpenALPR
Due to the difference in license plates (old vs. new), may I know what you are trying to achieve?

Personally I believe you are up for a challenge for years to come until the new license plates have been fully implemented.  I like to hear from you as I am active in parking and tolling applications.

--
Mikael

Nigel Andam

unread,
Dec 1, 2018, 8:46:02 AM12/1/18
to OpenALPR
Sir daniel, can I have a discussion with you so that I will gain more information about my project. Please help me, I'm a fellow filipino that are going to implement also this kind of project. Thank you!

Noel Patron

unread,
Feb 19, 2019, 7:44:00 AM2/19/19
to OpenALPR
were you successful in detecting philippine license plates?
Reply all
Reply to author
Forward
0 new messages