Singapore license plate

2,701 views
Skip to first unread message

Hien Linh Nguyen

unread,
Sep 22, 2015, 6:28:14 AM9/22/15
to OpenALPR
Hi all,

I'm adding singapore license plate to openalpr. So far I've trained the OCR with Singapore plates font and the result is ok so far. I'm uploading here all the files needed to use sg and another country code. Anyone with common interest are more than welcome to test it out. Perhaps we can collaborate to improve the results. 

Please note that it's working on 1-line plates only. 2 line plates requires a huge number of positive images to train, which I haven't got the time fore. I'm happy to contribute the images I've got so far to build a common dataset to further train the detector.

You should put sg.conf to runtimedata/config
lsg.traineddata to runtimedata/ocr/tessdata
sg.patterns to runtimedata/patterns
sg.xml to runtimedata/regions

Re install openalpr and it should work.

Best,

Linh
sg.conf
lsg.traineddata
sg.patterns
sg.xml

Matt

unread,
Sep 22, 2015, 8:59:44 AM9/22/15
to OpenALPR
Excellent!  Thanks, Linh.

If you can can post your original image data as well, that would be helpful for others since they would be able to add more images and retrain the dataset to improve accuracy.  If you post it here, I can grab the files and add them to the dataset.  Alternatively, you can fork and add a pull request to these repos:


Feel free to post whatever you have for your two line plates as well.  Perhaps we can keep adding to it until we have enough.  I'm in the same boat for European plates, I have about 600 or so.  I would need 1000 minimum for a viable detector.

-Matt

Hien Linh Nguyen

unread,
Sep 25, 2015, 11:53:54 AM9/25/15
to OpenALPR
Hey Matt,

I'm not sure whether it's okay to share the original images publicly since license plate data is private. Anyone interested can email me and I will share the whole folder (which has around 350 1-line plates and 140 2-line plates)

I used the EU plate detector and it seems to work well for SG plates. Do you want to try adding the SG 2-line plates to use together with EU 2-line for training the 2-line plate detector? I will share to your email if you need.

I have retrained the OCR on a new set of data (the 350 1-line plates), which sums up to around 2.3k characters (boy cropping the plates and classifying the characters  took a long time!).  The new OCR file is attached and seems to improve a lot from the previous one. Previously it sometimes confuses 0 with Q, but the new one classify the 2 quite well.

Maybe sometimes next week I will collect more data but I doubt if I can collect more than 200 2-lines plates.

Thanks,

Linh
lsg.traineddata

Hien Linh Nguyen

unread,
Sep 25, 2015, 11:58:39 AM9/25/15
to OpenALPR
A weird thing I noted: upon using the new lsg.trainedata and run alpr, i got this error:

*** Error in `alpr': double free or corruption (out): 0x000000000276ed40 ***
Aborted (core dumped)

Any ideas what this is about? Sorry I'm not that familiar with C++ debugging. I suspect it's because the new traineddata is much larger (since I used around 2.2k characters)



On Tuesday, September 22, 2015 at 8:59:44 PM UTC+8, Matt wrote:

Matt

unread,
Sep 27, 2015, 10:32:03 PM9/27/15
to OpenALPR
Any luck resolving this?  Are you training with the same version of Tesseract that is compiled into OpenALPR?

nglin...@gmail.com

unread,
Sep 28, 2015, 12:12:28 AM9/28/15
to Matt, OpenALPR
Hey I got it through by training using tesseract 3.03. It seems fine now. Thanks!


Sent from mobile


--
You received this message because you are subscribed to the Google Groups "OpenALPR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openalpr+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Khai Cher Lim

unread,
Sep 29, 2015, 3:33:56 AM9/29/15
to OpenALPR
Hi Hien Linh,

Thank you for training OCR with SG plates. I'm wondering which release of openAlpr did you use? I have a limitation where I have to use Windows. Thus i got my release from https://github.com/openalpr/openalpr/releases . After putting your files in the respective directories, I still didn't manage to recognize any SG car plates. Any help in this matter? Thank you. =)

Hien Linh Nguyen

unread,
Sep 29, 2015, 8:30:09 AM9/29/15
to OpenALPR
Hi Khai Cher,

I cloned the repository and built it on the local environment. What was the command you ran and what was the corresponding output?

Linh

Khai Cher Lim

unread,
Sep 29, 2015, 10:54:23 AM9/29/15
to OpenALPR
Hi Linh, 

I guess you are running on linux/mac os environment? I guess probably its more straight forward to set up.

I ran the command "alpr -c sg pathToImages/xxx.jpg"

nglin...@gmail.com

unread,
Sep 29, 2015, 11:20:30 AM9/29/15
to Khai Cher Lim, OpenALPR
And what wad the output? No plates detected?

You can try copy the eu.xml in runtime_data/region and trname it to sg.xml then try run that command again


Sent from mobile

Khai Cher Lim

unread,
Sep 30, 2015, 11:32:52 PM9/30/15
to OpenALPR, lim.kh...@gmail.com
Hi Linh,

Thanks. It works. Good job done =)

mikhail ulanday

unread,
Oct 1, 2015, 1:13:19 AM10/1/15
to OpenALPR, lim.kh...@gmail.com
Good day sir Linh Nguyen would you mind helping me or teaching me how to train as well in openalpr. Im new with openalpr but there are aspects of the training part that I don't seem to get. thanks :) I'll be training for the Philippine plates :)

Hien Linh Nguyen

unread,
Oct 8, 2015, 3:36:19 AM10/8/15
to OpenALPR, lim.kh...@gmail.com
Hey Mikhail you can check this page


look into train-ocr and train-detector. The train-ocr is for training character recognition, whereas train-detector is to detect the plate.

Hope that helps

Minh Hung Le

unread,
Mar 13, 2016, 11:20:08 PM3/13/16
to OpenALPR, nglin...@gmail.com
Hi Linh, would you please add config for Vietnamese plates?

Regards,

Hung Le

Reverse Slice

unread,
Sep 30, 2016, 4:52:50 AM9/30/16
to OpenALPR, nglin...@gmail.com
Hi Linh

I wonder if you could share the folder with me? I have sent a pm to you.


Chris

akshay....@ranosys.com

unread,
Mar 22, 2017, 7:52:38 AM3/22/17
to OpenALPR, nglin...@gmail.com
Hi i required traineddata file for iniad anpr system, can you please share the file if you have, Thanks (My mail - akshay....@ranosys.com)

Panya Yattham

unread,
Mar 23, 2017, 10:05:20 PM3/23/17
to OpenALPR, nglin...@gmail.com
Hi Linh,
May I have your advise or step of compile and train new country license plate. I'm no luck with that the step on wiki or internet not have enough details and out-date. I got errors hopeless to solve it by myself.
Thank you
Panya


On Tuesday, September 22, 2015 at 5:28:14 PM UTC+7, Hien Linh Nguyen wrote:

Xi Peng

unread,
May 8, 2017, 3:26:12 AM5/8/17
to OpenALPR, nglin...@gmail.com

Hi LInh,

I am working on Singapore double line license plate detection. I have prepared 900 sample images and could I ask you what are correct procedures to train the detection? I am confused about train-ocr and train-detetor since you used train-ocr for single line license plate but you mentioned train-detector is used for license plate detection. Should I use train-ocr as you did previously?

Thanks
Mike

Willie

unread,
Jun 13, 2017, 3:56:28 AM6/13/17
to OpenALPR, nglin...@gmail.com
Hi Linh, Mike and Matt,

Do any of you happen to already have a pretty decent sg2.xml (for 2 lines Singapore plate) file?
If you do, is it possible to share with me?

Many thanks,
Willie

Ying Jie Lim

unread,
Jun 15, 2017, 5:16:24 AM6/15/17
to OpenALPR, nglin...@gmail.com
Hi all,

I found this sg2.xml file from another forum.
sg2.xml

Tyler Buchman

unread,
Oct 31, 2017, 6:39:45 PM10/31/17
to OpenALPR
Im looking for a data set of labeled Singapore license plates, is it possible to use yours? Also, is there a license on this data set? Thanks for your consideration!


On Friday, September 25, 2015 at 8:53:54 AM UTC-7, Hien Linh Nguyen wrote:
Reply all
Reply to author
Forward
Message has been deleted
0 new messages