Training for a new country (India)

8,022 views
Skip to first unread message

Ajay vishnu

unread,
Feb 25, 2014, 9:04:54 PM2/25/14
to open...@googlegroups.com
First off, @Matt - Wonderful Initiative. 

I've added a few samples (attached) I used. This is what I observed :
  • The us & eu training doesn't seem to suffice for these.
  • For all of the images the characters seem to get trimmed.
  • Characters are omitted. Perhaps due to improper pattern settings.
  • 3.jpg is identified as two different number plates. Perhaps due to improper dimension settings.
  • 6.jpg should be bit of a long shot , if identified. Image is perhaps too skewed for alpr?

Hit some doubts here, while trying to resolve them. To be clear, I'll just jot them down as points, as well :
  • Changes to the pattern files,  in the runtime_directory -> postprocess -> country.patterns seem to make no difference. How do I set the pattern formats then?
  • Changes in dimensions of runtime_directory -> region -> country.xml makes no difference. Seems I'd have to make the changes in the python script & do a separate training?
  • How long does it take for a training of about 1000+ pos images & the 3000+ neg ones provided, to run with say, 12 stages?
    I used 1 positive image for a test & waited like 15 minutes on stage 2 until I cancelled it. Thought I'd run once with 1000+ itself if it takes so long.





8.jpg
6.jpg
7.jpg
3.jpg
2.jpg
4.jpg
5.jpg

Matt

unread,
Feb 26, 2014, 11:00:50 AM2/26/14
to open...@googlegroups.com
Hi Ajay,

Yes, I think you may get better results if you trained for Indian plates.  The plates look a bit wider than the EU plates, and the font seems more narrow.

There's a number of reasons why characters can get trimmed.  Most commonly, it's simply because the OCR has trouble recognizing them and drops them.  The OCR engine is trained against very specific fonts that are used for license plates.  The library also throws away OCR results when the quality is too low (it could be a trailer hitch, or a background graphic on the license plate).  If you added your font for Indian plates, you shouldn't see nearly as many letters dropped.

When the plate is identified as two separate plates, that's the LBP detector doing that.  Training for India plates would help.  I think it has to do with the gaps in between the characters and it gets confused and thinks there are two plates side by side.  I would expect the EU plate detector would do the best against your plate images.

The skewed plates (e.g., 6.jpg) should be possible to detect.  Admittedly, the code in OpenALPR for deskewing is far from perfect.  However, it does try and detect when the plate's lines are not rectangular, and it runs it through a deskewing algorithm to get it in the correct format for OCR.  The LBP detector isn't usually trained with images that are that far skewed, though, just because the accuracy would not be as good for countries like the US where the letters aren't as clear (i.e., they have graphics behind the letters that would be difficult to deskew and still get accurate results).

The patterns used in the postprocess directory are just used to run a regex analysis against the plate letters after OCR.  If you tell the license plate detector the region (i.e., this plate is from Maryland) then it will attempt to match all the candidate results using that Regex.  So, for example, if a plate scan has 3 possibilities ABZ123, ABSI23, and ABS123, and the plate is from Maryland with the pattern @@@###, then the first two results would be skipped, and it would choose the third pattern as the best (ABS123).

Training 1000 images with 3000 negatives should take about 5 minutes.  You should see output very quickly as it calculates the cascade stages.  The first stages will be calcluated quickly and the later stages take more and more time.  I think you'll need more positive samples to even get the thing to run.  When the OpenCV train_cascades program fails, it sometimes just spins the CPU and goes into an infinite loop.  Try running the training against the sample imageset in the https://github.com/openalpr/train-detector to get a feel for how it should work given a valid input.

-Matt

Ajay vishnu

unread,
Feb 26, 2014, 1:40:02 PM2/26/14
to open...@googlegroups.com
Thank you for the detailed reply Matt. Cleared a lot of doubts.

I'll revert back after carrying out all the necessary changes. 

Seems a bit of manual work for me, until then. Will try pulling some images from server. And go with a partially scripted way to crop those 1000+ images. 

Ajay vishnu

unread,
Apr 5, 2014, 4:02:58 AM4/5/14
to open...@googlegroups.com
Hi Matt

I wasn't able to run the detector out of the box for eu. So I kept thinking I had to figure out a lot more to even get it running & hence left it there. It was not until I noticed Phillippe raising the issue (https://groups.google.com/forum/#!topic/openalpr/ofuNNoCRtp4) that I picked up detector again. Can we perhaps add the hack(90% of the total images) in the train output command itself?

Currently, I've managed to collect nearly ~20,000 images. From a brief look, I think I'll get at least 10% of it to contain the license plates in it, which seems enough for training.

Since the training requires the images to cropped to exactly the size of license plates, How would you suggest me to go about it. The readme mentions about some image clipper program, but I'm not sure what it is referring to. 
 

On Wednesday, February 26, 2014 9:30:50 PM UTC+5:30, Matt wrote:

Matt

unread,
Apr 5, 2014, 12:09:01 PM4/5/14
to open...@googlegroups.com
Yes, Phillippe also pointed me to some resources that explain how to calculate the number more precisely.  I would like to implement that at some point so we can be assured we're using the right number.

I would recommend using the version of ImageClipper that I forked -- it has a few features that should make it easier to crop the plates.  The big one is locking the aspect ratio.  If you clone this repo:

Open the imageclipper.cpp program and change the constants for:
ASPECT_WIDTH and ASPECT_HEIGHT

to values that match your plate dimensions.  Then you can run it with "imageclipper [input directory]"

As you crop each plates, the program will drop the cropped image in a new directory (./imageclipper) and you can use those for training.

Philippe Vaucher

unread,
Apr 7, 2014, 3:35:10 AM4/7/14
to open...@googlegroups.com
Since the training requires the images to cropped to exactly the size of license plates, How would you suggest me to go about it. The readme mentions about some image clipper program, but I'm not sure what it is referring to. 

Since your plate are not *that* different from eu plates, I think you could also go at it another way: copy the [eu] section from openalpr.conf into [in] or whatever, then adapt the plate size there and do the same for runtime_data/ocr/lin.traineddata, fiddle with it until running ./alpr -c in someplate.jpg detects the plate. It's not important that it detects the plate correctly at this point, what's important is that openalpr detects the plate.

Then run it with the -j option which will give you the plate coordinates, and use that along with the `convert` utility to automatically crop the image to the plate coordinates, and now you have a cheap & easy plate extractor.

Then, use train-ocr to make it learn about your fonts, etc.

Ajay vishnu

unread,
Apr 7, 2014, 9:56:43 AM4/7/14
to open...@googlegroups.com
Interesting suggestion Philippe. I'll look into automating the work.

But contradictory to what we assumed, the Indian plates seemed to be detected better by the US training. While EU simply refused to spit out anything (perhaps fiddling with conf would work) 

I manually worked with ~ 6000 images & generated around 1200 plate samples for training. I did use the same EU configuration with some minor fiddling, though. And the identification seems way better now.

So of the few sample images I shared above (I did not use any of those for training)

2.jpg
 IN  - DWB4  confidence: 70.7485  template_match: 0
 US  - L8A800  confidence: 82.8638  template_match: 0
 EU  - D3B4  confidence: 71.4508  template_match: 0

3.jpg
 IN  - UP16F67  confidence: 88.1258  template_match: 0
 US - F6718  confidence: 85.0016  template_match: 0
 EU - NOTHING

4.jpg
 IN  - DL7CL593          confidence: 86.943 template_match: 0
 US - CL5983          confidence: 86.9523 template_match: 0
 EU - NOTHING

Seems the training is working & even the manual effort is paying off. 

Though I feel 3.jpg & 4.jpg are very much readable with some minor fiddling (1 character away) at this stage itself, I don't really know what I should tweak to get the last character in. 

Matt

unread,
Apr 7, 2014, 10:51:59 AM4/7/14
to open...@googlegroups.com
Ajay,

This looks great -- your accuracy seems to be significantly improved after training.  Are you interested in uploading your work so India can be included in the main OpenALPR library?

I can't tell, without trying to recognize it myself, whether your missing characters are due to the plate boundary being chopped off, or due to OCR issues.  If it's the latter, then perhaps training India OCR characters would help.

Also, you may want to try recognizing against the latest 'develop' branch.  I've made some improvements, recently, to the plate boundary detection (platelines.cpp) which may increase your accuracy.

-Matt

Ajay vishnu

unread,
Apr 8, 2014, 12:08:03 AM4/8/14
to open...@googlegroups.com
I would definitely be interested in including India into OpenALPR, Matt. 

Since I have some more images to crop out & train, I'll go ahead with them before uploading it. 

Regarding the training, when we crop the image the plates are often angled. When I crop them along that angle I get a skewed image. I noticed that some images in eu training were not cut out along the lines & hence contained license plate along with some background. Which way is better for training, in your opinion?


-Ajay

Matt

unread,
Apr 8, 2014, 10:40:36 AM4/8/14
to open...@googlegroups.com
It seems odd, but it's true that it's better to get a license plate with some background (i.e., not rotated) and maybe even clipped a little.  Here is a video that shows how the LBP algorithm works, which might help explain it:

It's basically scanning the image using progressively larger rectangles trying to find your patterns.  So, if you want to match license plates which are slightly rotated or skewed, you want your templates to include those in their original form. But the LBP algorithm does not rotate its rectangle, so it has to compare it to templates as-is.

Even if the LBP detector only captures a portion of the plate, the OpenALPR code has logic to find the correct plate boundaries (platelines.cpp and platecorners.cpp).  

Ajay vishnu

unread,
Apr 10, 2014, 1:42:59 PM4/10/14
to open...@googlegroups.com
Nope. Something definitely went wrong after I put around 200 + of casually cropped images. The training went all haywire, not sure why. I had to identify & remove them to take the training back one step. 

I'll continue to train again later but I think it's better I share my work so far... Would you like me to fork & commit? or should I commit into the develop branch of the openALPR? 

Matt

unread,
Apr 10, 2014, 10:06:53 PM4/10/14
to open...@googlegroups.com
Ajay,

Yes, please go ahead and fork/commit/push to the repo that you're using (I assume it is https://github.com/openalpr/train-detector).  I'll take a look at what you've got so far.

I would guess that 200 samples or so is still insufficient.  1000 is probably a minimal number for decent accuracy.

Matt

unread,
Apr 11, 2014, 10:04:54 PM4/11/14
to open...@googlegroups.com
Ajay, I saw you committed the cascade XML files.  I'll need the original images that you used to train, as well as the command you used to create the cascade file.  Otherwise, I can't give you any helpful advice.

-Matt

Ajay vishnu

unread,
Apr 13, 2014, 3:07:39 PM4/13/14
to open...@googlegroups.com
Hi Matt

I was a bit gated over the weekend & missed to shoot an update.  

I would guess that 200 samples or so is still insufficient.  1000 is probably a minimal number for decent accuracy.

I actually meant additional 200 samples to the existing ~1200. The problem I was referring to was messing up of the sample training folder & that I needed to take a step back and figure out the optimal conditions which gave better results before uploading.

I do have the older cascade xml, but just that now the sample folder is a bit altered & so are the settings. Since I had to manually clean up the new ones, I have a bit different results now. You can see the difference by testing the xml I've attached with the post. 

Either ways, the last training I ran was with :

/home/ajay/workspace/alpr/opencv/bin/opencv_traincascade -data /home/ajay/workspace/alpr/dev-openalpr/train-detector/out// -vec /home/ajay/workspace/alpr/dev-openalpr/train-detector/positive/vecfile.vec -bg /home/ajay/workspace/alpr/dev-openalpr/train-detector/negative/negative.txt -w 52 -h 13 -numPos 1063 -numNeg 3248 -featureType LBP -numStages 13

And you can find the samples here : https://github.com/loxxy/train-detector/tree/master/in

- Ajay
in.xml

Matt

unread,
Apr 13, 2014, 10:54:35 PM4/13/14
to open...@googlegroups.com
Ajay,

Thanks for uploading your India region detector.  I'm sure it will be useful to many people.

What kind of accuracy are you seeing currently -- is it pretty good, or does the EU detector come close or outperform it?

I pulled your repos and took a look at the input data.  One thing I noticed is that the aspect ratio for each of the crops seems to vary a bit.  For example, this image is set to a width of 204x66 (3.091 ratio) and another image has a ratio of 88x100 (0.88 ratio).  What happens when these go to training, is that everything gets resized to a uniform size -- in this case it's set to 52x13 (4.0 ratio).  

So many of your images are getting stretched to the point where they may appear to be distorted and could be hurting the detector accuracy.  Image #3 is an example of the 88x100 image stretched to match a 4.0 aspect ratio.

The European plates use a 4.0 ratio -- that may work fine as well for the Indian plates, or it may need to be tweaked slightly if it's a different size.  The important thing is that the crops also have those same exact proportions so that when the images get resized, they still look like the original.
Audi-A4-528794d.jpg_0359_0305_0250_0204_0066.png
Honda-City-ZX-528549c.jpg_0000_0564_0430_0088_0100.png
hondastretched.png

Ajay vishnu

unread,
Apr 15, 2014, 12:21:12 AM4/15/14
to open...@googlegroups.com
Matt 

I'm getting varied results after each training. The same samples which might be detected well once is not detected the other time.

Most recent: 

 2.jpg   
    - 0LCABO18 confidence: 82.2987 template_match: 0
 3.jpg   

    - UP16F718 confidence: 89.9506 template_match: 0
    - UP16F671 confidence: 89.0551 template_match: 0
    - UP16F71B confidence: 88.6844 template_match: 0
    - UP16F71 confidence: 88.6287 template_match: 0
 
EU training doesn't help. I tried tweaking the configuration to match indian training, but still it's way off the mark or nothing at all.

If you notice 3.jpg seems to be there (actual UP16F6718). I fail to understand why a character from the middle is omitted in either of the possibilities. OCR seems to be recognizing the characters. If you could, please throw some light into the most important items of the config file as well.

I will re visit all the samples & remove any which might be hurting the training as you mentioned.

- Ajay

Matt

unread,
Apr 16, 2014, 12:36:46 AM4/16/14
to open...@googlegroups.com
Characters are omitted if their OCR recognition score is too low (ocr.cpp), or they fail to be included in character segmentation (charactersegmenter.cpp).  If you turn on all the debug options, it should show you some graphics that will help explain it.  If the character segmentation graphic doesn't have a box drawn around that character's position, than it was not included.

More likely, though, is that the OCR could not get a good enough read on the character so it dropped it.  Your results will change every time you modify the input image or the runtime data.  So it's perfectly plausible that one run would produce a good reading and another would produce something different.  Any slight variation will send a slightly different image to detection and OCR, and the heuristics could produce different results.


-Matt
Message has been deleted

Priya Kumari

unread,
May 20, 2014, 5:26:41 AM5/20/14
to open...@googlegroups.com
Hi, I am a new member to this group. I am working on this ALPR project for Indian license plates as my M.Tech project.I have hardly 10 days time left for my submissions. i am unable to understand most of the coding part as i m not really good at it. Friend please help me with the coding

Matt

unread,
May 20, 2014, 8:34:39 AM5/20/14
to open...@googlegroups.com
To train for Indian license plates, you shouldn't need to do any coding.  You'll just need to collect a lot of license plate images (at least 1000, preferably more), and then do the following:
Train detector has some examples of good crop images.  Don't be afraid of grabbing a little extra on the sides, or cropping out on the top.  The key is getting images of the same aspect ratio that is centered on the plate that you want.

Priya Kumari

unread,
May 20, 2014, 10:41:00 AM5/20/14
to open...@googlegroups.com
Hi Matt, I am very much thankful to you for your support. But I still need a lot of help from you. Can we interact through gtalk or the gmail services.

Steve Langston

unread,
May 20, 2014, 1:01:10 PM5/20/14
to open...@googlegroups.com
This is really useful.  I want to train for UK plates and am now back in the UK so hope to soon be able to go through this myself!
 
Now i just need an old laptop to install Ubuntu so i can get image clipper working.
 
Steve
--
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.

Nikhil Khatwani

unread,
Oct 27, 2014, 12:48:45 PM10/27/14
to open...@googlegroups.com
Hi Matt/Ajay,

@Matt: Could you please share an update around the integration of changes related to supporting India region based on discussions on above thread. Looking at https://github.com/loxxy/openalpr/, it looks like changes are not yet integrated.

@Ajay: I cloned your fork https://github.com/loxxy/openalpr/  but on invoking make, iget following error:

[  3%] Building CXX object openalpr/CMakeFiles/openalpr.dir/alpr.cpp.o
In file included from /home/nikhil/Desktop/loxxy/openalpr/src/openalpr/alpr_impl.h:31:0,
                 from /home/nikhil/Desktop/loxxy/openalpr/src/openalpr/alpr.cpp:21:
/home/nikhil/Desktop/loxxy/openalpr/src/openalpr/ocr.h:37:21: fatal error: baseapi.h: No such file or directory
 #include "baseapi.h"
                     ^
compilation terminated.
make[2]: *** [openalpr/CMakeFiles/openalpr.dir/alpr.cpp.o] Error 1
make[1]: *** [openalpr/CMakeFiles/openalpr.dir/all] Error 2
make: *** [all] Error 2

Could you please comment on this.

Thanks,

Nikhil

Matt

unread,
Oct 27, 2014, 8:29:49 PM10/27/14
to open...@googlegroups.com
Nikhil,

You're correct, I did not merge this dataset.  The aspect ratio for the training data was variable (which can cause poor accuracy).  The detector, in this case, was not as good at detecting Indian plates as the European detector.

-Matt

akash bhatt

unread,
Apr 11, 2015, 10:58:01 AM4/11/15
to open...@googlegroups.com
Hello Ajay I am Akash I am doing a project on number plate recognition. Can you tell me that what we have to do of that in..xml file for recognizing indian number plates?
Can we directly put it into runtime_data/region?

Sachin tyagi

unread,
May 25, 2015, 1:31:25 PM5/25/15
to open...@googlegroups.com
Hi Ajay
I configure the openalpr and integrate it with java, it works well as it has trained data for US and EU, i want to make it capable for india license plates.Can you please help to understand the process and guide me how much plate images are enough for indian openalpr.

Regards,
Sachin

binayak ghosh

unread,
Feb 8, 2016, 2:15:08 PM2/8/16
to OpenALPR
Hi Ajay and Matt,

Thanks a lot for sharing. I have been working on openalpr for last couple of months and I have been trying to add Indian pattern into it. My research has fetched me following information regarding license plates in India. However, I am finding it hard to change the patterns file and dimensions in xml file. Can you please guide me to incorporate.

--------------------------------------------------------------------------------------------------------------------------------------------

Point of consideration while reading Indian License Plate:

1. Installation of High Security Registration Plates (HSRP) has been made mandadatary for every vehicles plying on Indian road. So, gradually vehicles with non-standard license plate with phase out in near future, easing the process of automated license plate reading process.

2. Standard dimension for number plates un HSPR:
a) 2 wheelers - 200 x 100 mm & 285 x 45mm(Font)
b) Car / LMVs - 340 x 200 mm & 500x120 mm
c) Medium / Heavy Vehicles - 340 x 200 mm

3. Format of HSPR:
a) The first two letters indicate the state or Union Territory to which the vehicle is registered (ie. first two units will always be English letters).
b) The next two digit numbers are the sequential number of a district. In special cases, the initial 0 of the district code is omitted; thus Delhi district 2 numbers appear as DL 2 not DL 02, GJ 5 not GJ 05, BR 8 not BR 08 (ie. in most cases, 3rd and 4th unit will be numerical, though special case may arise 4th unit).
c) The third part is a 4 digit number unique to each plate. A letter(s) is prefixed when the 4 digit number runs out and then two letters and so on (ie. last 4 units will always be numerical).

4. State / Union Territory Codes under HSPR scheme:
AN     Andaman and Nicobar Islands
AP     Andhra Pradesh
AR     Arunachal Pradesh
AS     Assam
BR     Bihar
CG     Chhattisgarh
CH     Chandigarh
DD     Daman and Diu
DL     Delhi
DN     Dadra and Nagar Haveli
GA     Goa
GJ     Gujarat
HR     Haryana
HP     Himachal Pradesh
JH     Jharkhand
JK     Jammu and Kashmir
KA     Karnataka
KL     Kerala
LD     Lakshadweep
MH     Maharashtra
ML     Meghalaya
MN     Manipur
MP     Madhya Pradesh
MZ     Mizoram
NL     Nagaland
OD     Odisha
OR     Odisha (previously used; no longer in use for new registration)
PB     Punjab   
PY     Puducherry
RJ     Rajasthan
SK     Sikkim
TN     Tamil Nadu
TR     Tripura
TS     Telangana
UK     Uttarakhand
UA     Uttaranchal (previously used; no longer in use for new registration)
UP     Uttar Pradesh
WB     West Bengal

5. Colouring scheme under HSPR:
a) Plates for private car and motorised two-wheeler owners have black lettering on a white background.
b) Commercial vehicles such as taxis and trucks have a yellow background and black text.
c) Commercial vehicles available on rent for self-drive have yellow lettering on a black background.
d) Vehicles belonging to foreign consulates have white lettering on a light blue background.

Matt

unread,
Feb 9, 2016, 8:37:25 PM2/9/16
to OpenALPR
1. That's great.  A standard will make it much easier.

2. I wonder how common these different formats are?  The library can support a single country with multiple dimensions, however each additional style that you try and detect adds an additional LBP pass over the image, which is expensive.  If one plate format (e.g., 340x200mm) is the most common (i.e., > 80% of the plates), it may be best to target that one.

3. Formats are good.  The pattern detection will allow you to get better accuracy since it knows to use a number versus character (e.g., 8 instead of B).

5. Font colors and backgrounds won't matter, OpenALPR can pick them all up.  Just make sure all the styles are incorporated into your training data.

binayak ghosh

unread,
Feb 10, 2016, 11:26:11 AM2/10/16
to OpenALPR
Hi Matt,

In India, some plates have multi-line while some doesn't. This leads to multiple dimension. Is there any way to detect both multiple and single line using single configuration? When I changed the in.conf file to multiline = 1, it stopped working for single line plates.
Also, how to support multiple dimensions (though I am more concerned about accuracy than computation power)?
Moreover, any support over detection of color of number plate?

I am training alpr with varieties of fonts available in Indian plates using real camera feed. Shall be making it public when i am done.

Thanks,
Binayak

Matt

unread,
Feb 11, 2016, 11:21:55 PM2/11/16
to OpenALPR
Yes, the software supports trying multiple plate types.  For example, if you ran "alpr -c us,eu [plate image]"  it would search the image using both the us and eu dataset.  If there's any duplicates, it would pick the one with higher confidence.  You would do this for your India training data (alpr -c in,in2 [plate image]"  The disadvantage is that it takes almost twice as long to process since it has to pass over the image twice.

Not sure what you mean about detection of color.

Saurav Gupta

unread,
Feb 29, 2016, 6:52:40 AM2/29/16
to OpenALPR
Hey Ajay, 
Can you pass on your openalpr.config file and lintrainedocr if you trained the OCR? Thanks a lot!
Saurav
Message has been deleted

Ishwar Sawale

unread,
Mar 7, 2016, 2:15:19 AM3/7/16
to OpenALPR
I am trying to build openlapr for Indian plate but most of time it skipping plates  and one its detecting are not giving right output

    you can find my repo at  www.github.com/ishwarsawale 
in.conf
in.xml
in.patterns
in.patterns

Matt

unread,
Mar 8, 2016, 9:06:26 PM3/8/16
to OpenALPR
How many plates did you use to train the detector?  You can use the "endtoend" benchmark utility to give you a good estimate for how accurate (true/false positive rate) your detector and OCR is.  As you add more clean data to your training set, those numbers should improve.

Vladimir Radnovic

unread,
Mar 10, 2016, 2:57:33 AM3/10/16
to OpenALPR
Ishwar Sawale how many image ( type ) of india plate u use for training ?
can u send me mail private... I have lot of indian plate if u need for train... ( I don't have time to train )

tnx
vladimir

Sunny dhiman

unread,
Mar 15, 2016, 3:32:27 AM3/15/16
to OpenALPR
Hi Vladimir Radnovic.

can you send me indian plate sample for train..please (ssdhi...@gmail.com)

Thank you.

Ishwar Sawale

unread,
Mar 15, 2016, 4:34:22 AM3/15/16
to OpenALPR
I am using 1200 image, I manually cropped them using imageclipper with aspect ratio of 4.5 but not getting result that wanted, thanks for suggestion gonna run that benchmark.

Tan Le Van

unread,
Mar 15, 2016, 6:55:23 AM3/15/16
to OpenALPR
Hi Matt,

I used dll from openalpr but i dont know how use alpr -c us,eu plateimage. i mean detect a plate with multiple country. can you tell me how it on c#?

thanks

Minh Hung Le

unread,
Mar 16, 2016, 6:07:29 AM3/16/16
to OpenALPR
Hi Tan,

Seem you has a config for Vietnamese plates. Can you share us for me?

Thanks so much.

binayak ghosh

unread,
Apr 4, 2016, 1:53:09 AM4/4/16
to OpenALPR
Hey Ishwar,
I have been working on Indian plates for pretty long time. But i am finding it difficult to get images of indian plates. Can you suggest me a way? Or can you mail me your collection at hellob...@gmail.com

binayak ghosh

unread,
Apr 4, 2016, 1:55:20 AM4/4/16
to OpenALPR
Can you send the plate images at hellob...@gmail.com
TIA

amande...@competentgroove.com

unread,
May 24, 2016, 1:42:07 AM5/24/16
to OpenALPR
Hey Ishwar, 
I have been working on Indian plates . But i am getting issues for finding indian plates can. Can you please share images on aman9...@hotmail.com.

amande...@competentgroove.com

unread,
May 24, 2016, 1:51:58 AM5/24/16
to OpenALPR
HI Ishwar ,

I have added attached files for India but trineddata is missing for India. can you please share with me on aman9...@hotmail.com.

Thanks.


in.patterns
in.xml

Vladimir Radnovic

unread,
May 24, 2016, 2:00:46 AM5/24/16
to OpenALPR
do u make train detectror for india plates ?

amande...@competentgroove.com

unread,
May 24, 2016, 2:44:56 AM5/24/16
to OpenALPR
i didn't get, here what exactly meaning of train ? I have download 10-20 images from internet with Indian Number plates format and i am getting It was not possible to detect the licence plate.

amande...@competentgroove.com

unread,
May 24, 2016, 2:54:00 AM5/24/16
to OpenALPR

Hi Vladimir,

I have added in.xml file in region, also attached same file. Please check it and do let me know if i am doing something wrong.


On Tuesday, May 24, 2016 at 11:30:46 AM UTC+5:30, Vladimir Radnovic wrote:
in.xml
Message has been deleted
Message has been deleted

Ven

unread,
Jun 6, 2016, 6:15:25 PM6/6/16
to OpenALPR
Hi Vladimir,

I am trying to use openALPR for a project.
Is it possible to upload indian number plate images to Google Drive.

Kind Regards,
Venki

Ven

unread,
Jun 6, 2016, 6:17:50 PM6/6/16
to OpenALPR
Hi Ajay, Matt,

Is it possible to share the status of training OpenALPR for indian number plates.
If you guys have any trained data, please share.

Kind Regards,
Venki

Vladimir Radnovic

unread,
Jun 6, 2016, 6:24:18 PM6/6/16
to OpenALPR
Hi, If u work on project u can collect image.....
U have cameras... and u can collecte how many plates u want in india it's not problem :)

Vladimir Radnovic

unread,
Jun 6, 2016, 6:25:05 PM6/6/16
to OpenALPR
No there is no shere data for Indian plates...

Ven

unread,
Jun 7, 2016, 3:53:28 AM6/7/16
to OpenALPR
😀😀😀😀 indeed.
Thank you Valdimir for the info.
The reason for asking Indian number plates is that somewhere in the thread I saw you mentioned you have lot of Indian number plates.
I was wondering if you still have them.

Vladimir Radnovic

unread,
Jun 7, 2016, 3:54:46 AM6/7/16
to OpenALPR
I have it, bat it's not for public shering....

Ven

unread,
Jun 7, 2016, 4:49:27 AM6/7/16
to OpenALPR
Ok Thank you Valdimir.
Is it possible to send to my mail.

Ven

unread,
Jun 7, 2016, 4:59:29 AM6/7/16
to OpenALPR
@ Valdimir
Please let me know if it is possible to share in a mail, so that I can give my mail id.

Thank you...

mydroi...@gmail.com

unread,
Jul 24, 2016, 1:55:36 PM7/24/16
to OpenALPR
Hi Matt, Ajay, Binayak,

OpenALPR has opened new avenues and it's implementation in various countries is picking up pace.
I also tried my hands on it and found it to be accurate on us and eu plates.

I have been following up this group and was looking for an update on indian number plates. I don't find any 'in.traineddata', 'in.xml', 'in.patterns' which may produce accurate results like US plates.

Not sure if we really progressed in this direction. However, I would really appreciate If there is any update or any updates files which I can use for indian plates.

Thanks,
Abhishek.

Matt

unread,
Jul 28, 2016, 7:56:43 AM7/28/16
to OpenALPR
I'd be willing to do the training, but I need lots of Indian plate images.  So far I have none.

Abhishek M

unread,
Jul 28, 2016, 10:05:32 AM7/28/16
to Matt, OpenALPR
Thanks Matt. 

India is the Go-To market now a days for many companies. If your tool supports indian plates, it will open up lots of opportunities for small,  medium and big corporates to provide better services to their customers. 

I think Ajay has already uploaded thousands of indian number plates.  Let us know if you cant access them. We'll figure out a way to help you with this. 

Besides this, I had an observation using google goggles. If I select and crop the number plate in the picture using  goggles,  it gives me instant and precise results.  I believe it uses Tesseract OCR which is used in your tool too (correct me if I am wrong).  

Indian car plates are not in a particular format yet and enforcing standards on a few billion people will take few more years. 

I guess in Indian scenario its more about just reading the plain text from the number plates without following up much on the size, fonts and format of the license number plate. 

The current format is SS NN XX NNNN
Where- 
SS- State identifier e.g. TN for Tamilnadu (2 Chars) 
XX- 2 random chars
N- Numbers.

Really appreciate that you are willing to do this. Looking forward to it. 

Thanks, 
Abhishek
--
You received this message because you are subscribed to a topic in the Google Groups "OpenALPR" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openalpr/M5ehTr8yG-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openalpr+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vladimir Radnovic

unread,
Jul 28, 2016, 3:21:53 PM7/28/16
to OpenALPR, matt...@openalpr.com
Hello Abhishek
I have million of image from India taken from ANPR cameras etc....
Problem in Indian plates is 
1) it's not reflect plates on night time can make issues 
2) every states have owne design
3) to many different tipe + fonts 

to make good ( reading ) we need some one to "tag plates", crop train etc....
to do something like this it's take time+many no one what to do for free.....

ps. I know Indian market very very goood ( we are working on him 4-5years.... )

tnx
Vladimir

binayak ghosh

unread,
Jul 28, 2016, 3:38:52 PM7/28/16
to Vladimir Radnovic, OpenALPR, matt...@openalpr.com

Hi Vladimir,
We too have been working on Indian number plates as an open source research project for last 8 months and success rate has been around 80%. To meat industry standards, at least 90 % is desired.
Good news is that Indian govt is pressing upon smart licence plates which have standard size and fonts.
I would appreciate if you can share Indian number plate images so that we can train a new model for better accuracy.

Regards,
Binayak Ghosh

--

Matt

unread,
Aug 5, 2016, 9:00:10 AM8/5/16
to OpenALPR, vladimir...@gmail.com, matt...@openalpr.com
I have not received any usable sample images for Indian plates yet.  Someone uploaded a bunch of images at one point, but they cropped them all at various aspect ratios.  For the LBP detection, this won't work, since the aspect ratio needs to be the same.

If you can upload whatever you have to this repo:

That may help kickstart things for others to contribute as well.
To unsubscribe from this group and all its topics, send an email to openalpr+unsubscribe@googlegroups.com.

sunny

unread,
Oct 19, 2016, 12:51:41 PM10/19/16
to OpenALPR
Hi Ishwar Sawale,Vladimir Radnovic .

I don't have any images of Indian plate sample to train and cannot find in web. Can you send me Indian plate samples to this mail address (snsun...@gmail.com)

Thank you.

On Tuesday, March 15, 2016 at 2:04:22 PM UTC+5:30, Ishwar Sawale wrote:
I am using 1200 image, I manually cropped them using imageclipper with aspect ratio of 4.5 but not getting result that wanted, thanks for suggestion gonna run that benchmark.

On Wednesday, March 9, 2016 at 7:36:26 AM UTC+5:30, Matt wrote:
How many plates did you use to train the detector?  You can use the "endtoend" benchmark utility to give you a good estimate for how accurate (true/false positive rate) your detector and OCR is.  As you add more clean data to your training set, those numbers should improve.

On Monday, March 7, 2016 at 2:15:19 AM UTC-5, Ishwar Sawale wrote:
I am trying to build openlapr for Indian plate but most of time it skipping plates  and one its detecting are not giving right output

    you can find my repo at  www.github.com/ishwarsawale 

Ajay vishnu

unread,
Oct 28, 2016, 10:42:26 AM10/28/16
to OpenALPR, vladimir...@gmail.com, matt...@openalpr.com
Hey Matt & everyone

Sorry for the radio silence as I had stopped following this group.

If it's of any help, I remember having uploaded a major chuck of sample back here... https://github.com/loxxy/train-detector/tree/master/in 
To unsubscribe from this group and all its topics, send an email to openalpr+u...@googlegroups.com.

Hanut Singh

unread,
Nov 7, 2016, 6:53:48 PM11/7/16
to OpenALPR, vladimir...@gmail.com, matt...@openalpr.com
Hi guys. I have been looking into LPR for a short while and was really interested in seeing what OpenALPR could offer for Indian number plates.
@Matt - How many images of the standardized number plates would you need for us to get a good accuracy for Indian Number plates ?
I could help get the images if that will atleast get the ball rolling on getting Indian numberplates into OpenALPR

Matt

unread,
Nov 7, 2016, 8:48:24 PM11/7/16
to OpenALPR, vladimir...@gmail.com, matt...@openalpr.com
2000 or so plate images would be enough to get a good baseline accuracy.  After 15000 or so it no longer makes a big difference for accuracy using the current approach for plate detection.

Hanut Singh

unread,
Nov 8, 2016, 2:04:35 PM11/8/16
to OpenALPR, vladimir...@gmail.com, matt...@openalpr.com
So if I get my team to collect the images and send them over we can integrate IN plates into OpenALPR ?
If so, then how long would it take to get a release of OpenALPR with IN plates integrated?

Cheers!

Vladimir Radnovic

unread,
Nov 8, 2016, 2:07:04 PM11/8/16
to Hanut Singh, Matt Hill, OpenALPR

You can make your self if u have time
I can give you image bat i dont have time to work on in. What state you what to train ?

Matt

unread,
Nov 11, 2016, 8:17:11 PM11/11/16
to OpenALPR, vladimir...@gmail.com, matt...@openalpr.com
Hanut,

If you make the plate images available, it's likely that someone (I may have some time to help) would take the time to get them tagged and trained.  Instructions for doing the training yourself are here, if you're interested:

-Matt
Message has been deleted

Ashish Desai

unread,
Jul 20, 2017, 3:02:05 AM7/20/17
to OpenALPR

Hello Vladimir, Can you please share the Indian number plates you have?

Brijesh Giri

unread,
Aug 8, 2017, 10:09:20 AM8/8/17
to OpenALPR
I have tried training for india but i am not getting good results... Am i doing something wrong?? Can some help me with training if i provide the images for number plates?
On Wednesday, 26 February 2014 07:34:54 UTC+5:30, Ajay vishnu wrote:
First off, @Matt - Wonderful Initiative. 

I've added a few samples (attached) I used. This is what I observed :
  • The us & eu training doesn't seem to suffice for these.
  • For all of the images the characters seem to get trimmed.
  • Characters are omitted. Perhaps due to improper pattern settings.
  • 3.jpg is identified as two different number plates. Perhaps due to improper dimension settings.
  • 6.jpg should be bit of a long shot , if identified. Image is perhaps too skewed for alpr?

Hit some doubts here, while trying to resolve them. To be clear, I'll just jot them down as points, as well :
  • Changes to the pattern files,  in the runtime_directory -> postprocess -> country.patterns seem to make no difference. How do I set the pattern formats then?
  • Changes in dimensions of runtime_directory -> region -> country.xml makes no difference. Seems I'd have to make the changes in the python script & do a separate training?
  • How long does it take for a training of about 1000+ pos images & the 3000+ neg ones provided, to run with say, 12 stages?
    I used 1 positive image for a test & waited like 15 minutes on stage 2 until I cancelled it. Thought I'd run once with 1000+ itself if it takes so long.





Ashish Desai

unread,
Aug 8, 2017, 10:50:45 AM8/8/17
to Brijesh Giri, OpenALPR
Hello Brijesh. Surely we can help. For tesseract you have to train using similar types of fonts. It would be great help if you share number plates. 
--
You received this message because you are subscribed to a topic in the Google Groups "OpenALPR" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openalpr/M5ehTr8yG-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openalpr+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Regards
Ashish

Abdul Wahab

unread,
Aug 22, 2017, 4:33:43 PM8/22/17
to OpenALPR
when I run crop_plates.py it shows an error "from cv2.cv import * ImportError: No module named cv". Can you help?

Akash Jobanputra

unread,
Aug 24, 2017, 2:41:02 AM8/24/17
to OpenALPR
instead of
from cv2.cv import *
try this
import cv2

Abdul Wahab

unread,
Aug 26, 2017, 6:50:15 AM8/26/17
to OpenALPR

Akash thanks for your reply. I have trained detector for 208 positive images and 100 negative images because I don't have much training data for my country. Now I have cascade.xml file problem is that I don't have config file for my country and It is not detecting plates? can you help me....

Ashish Desai

unread,
Aug 27, 2017, 11:30:39 AM8/27/17
to OpenALPR
Hello Abdul,

Firstly 208 are very less images. you need atleast 2k-5k images to work with. About the config file, you will have to figure it out based on the physical dimensions of the number plate in your images.

Akash Jobanputra

unread,
Aug 28, 2017, 1:12:24 AM8/28/17
to OpenALPR
I haven't understand the config files yet. If you know, can you please tell me what are the four numerical ranges at the beginning of config files ?

Ashish Desai

unread,
Aug 28, 2017, 1:42:11 AM8/28/17
to OpenALPR
it is explained by Matt here

Akash Jobanputra

unread,
Aug 28, 2017, 1:53:07 AM8/28/17
to OpenALPR
Ok, Thank you Ashish!

Virupaksha Kulkarni

unread,
Jan 18, 2018, 7:13:48 AM1/18/18
to OpenALPR
On Monday, April 14, 2014 at 12:37:39 AM UTC+5:30, Ajay vishnu wrote:
> Hi Matt
>
>
> I was a bit gated over the weekend & missed to shoot an update.  
>
> I would guess that 200 samples or so is still insufficient.  1000 is probably a minimal number for decent accuracy.
>
>
> I actually meant additional 200 samples to the existing ~1200. The problem I was referring to was messing up of the sample training folder & that I needed to take a step back and figure out the optimal conditions which gave better results before uploading.
>
>
> I do have the older cascade xml, but just that now the sample folder is a bit altered & so are the settings. Since I had to manually clean up the new ones, I have a bit different results now. You can see the difference by testing the xml I've attached with the post. 
>
>
> Either ways, the last training I ran was with :
>
> /home/ajay/workspace/alpr/opencv/bin/opencv_traincascade -data /home/ajay/workspace/alpr/dev-openalpr/train-detector/out// -vec /home/ajay/workspace/alpr/dev-openalpr/train-detector/positive/vecfile.vec -bg /home/ajay/workspace/alpr/dev-openalpr/train-detector/negative/negative.txt -w 52 -h 13 -numPos 1063 -numNeg 3248 -featureType LBP -numStages 13
>
>
>
> And you can find the samples here : https://github.com/loxxy/train-detector/tree/master/in
>
>
>
> - Ajay
>
>
> On Saturday, April 12, 2014 7:34:54 AM UTC+5:30, Matt wrote:
> Ajay, I saw you committed the cascade XML files.  I'll need the original images that you used to train, as well as the command you used to create the cascade file.  Otherwise, I can't give you any helpful advice.
>
>
> -Matt
>
> On Thursday, April 10, 2014 9:06:53 PM UTC-5, Matt wrote:
> Ajay,
>
>
> Yes, please go ahead and fork/commit/push to the repo that you're using (I assume it is https://github.com/openalpr/train-detector).  I'll take a look at what you've got so far.
>
>
> I would guess that 200 samples or so is still insufficient.  1000 is probably a minimal number for decent accuracy.
>
> On Thursday, April 10, 2014 12:42:59 PM UTC-5, Ajay vishnu wrote:
> Nope. Something definitely went wrong after I put around 200 + of casually cropped images. The training went all haywire, not sure why. I had to identify & remove them to take the training back one step. 
>
>
> I'll continue to train again later but I think it's better I share my work so far... Would you like me to fork & commit? or should I commit into the develop branch of the openALPR? 
>
>
>
>
>
>
>
> On Tuesday, April 8, 2014 8:10:36 PM UTC+5:30, Matt wrote:
> It seems odd, but it's true that it's better to get a license plate with some background (i.e., not rotated) and maybe even clipped a little.  Here is a video that shows how the LBP algorithm works, which might help explain it:
> https://www.youtube.com/watch?v=nVbaNcRldmw
>
>
> It's basically scanning the image using progressively larger rectangles trying to find your patterns.  So, if you want to match license plates which are slightly rotated or skewed, you want your templates to include those in their original form. But the LBP algorithm does not rotate its rectangle, so it has to compare it to templates as-is.
>
>
> Even if the LBP detector only captures a portion of the plate, the OpenALPR code has logic to find the correct plate boundaries (platelines.cpp and platecorners.cpp).  
>
>
>
> On Monday, April 7, 2014 11:08:03 PM UTC-5, Ajay vishnu wrote:
>
> I would definitely be interested in including India into OpenALPR, Matt. 
>
>
> Since I have some more images to crop out & train, I'll go ahead with them before uploading it. 
>
>
> Regarding the training, when we crop the image the plates are often angled. When I crop them along that angle I get a skewed image. I noticed that some images in eu training were not cut out along the lines & hence contained license plate along with some background. Which way is better for training, in your opinion?
>
>
>
>
>
> -Ajay
>
> On Monday, April 7, 2014 8:21:59 PM UTC+5:30, Matt wrote:
> Ajay,
>
>
> This looks great -- your accuracy seems to be significantly improved after training.  Are you interested in uploading your work so India can be included in the main OpenALPR library?
>
>
> I can't tell, without trying to recognize it myself, whether your missing characters are due to the plate boundary being chopped off, or due to OCR issues.  If it's the latter, then perhaps training India OCR characters would help.
>
>
> Also, you may want to try recognizing against the latest 'develop' branch.  I've made some improvements, recently, to the plate boundary detection (platelines.cpp) which may increase your accuracy.
>
>
> -Matt
>
> On Monday, April 7, 2014 8:56:43 AM UTC-5, Ajay vishnu wrote:
> Interesting suggestion Philippe. I'll look into automating the work.
>
>
> But contradictory to what we assumed, the Indian plates seemed to be detected better by the US training. While EU simply refused to spit out anything (perhaps fiddling with conf would work) 
>
> I manually worked with ~ 6000 images & generated around 1200 plate samples for training. I did use the same EU configuration with some minor fiddling, though. And the identification seems way better now.
>
>
> So of the few sample images I shared above (I did not use any of those for training)
>
>
>
> 2.jpg IN  - DWB4  confidence: 70.7485  template_match: 0
>  US  - L8A800  confidence: 82.8638  template_match: 0
>  EU  - D3B4  confidence: 71.4508  template_match: 0
>
>
>
> 3.jpg
>
>  IN  - UP16F67  confidence: 88.1258  template_match: 0
>  US - F6718  confidence: 85.0016  template_match: 0
>  EU - NOTHING
>
>
> 4.jpg
>
>  IN  - DL7CL593          confidence: 86.943 template_match: 0
>
>  US - CL5983          confidence: 86.9523 template_match: 0
>  EU - NOTHING
>
>
> Seems the training is working & even the manual effort is paying off. 
>
>
> Though I feel 3.jpg & 4.jpg are very much readable with some minor fiddling (1 character away) at this stage itself, I don't really know what I should tweak to get the last character in. 
>
>
>   
>
> On Monday, April 7, 2014 1:05:10 PM UTC+5:30, Philippe Vaucher wrote:
>
>
> Since the training requires the images to cropped to exactly the size of license plates, How would you suggest me to go about it. The readme mentions about some image clipper program, but I'm not sure what it is referring to. 
>
>
> Since your plate are not *that* different from eu plates, I think you could also go at it another way: copy the [eu] section from openalpr.conf into [in] or whatever, then adapt the plate size there and do the same for runtime_data/ocr/lin.traineddata, fiddle with it until running ./alpr -c in someplate.jpg detects the plate. It's not important that it detects the plate correctly at this point, what's important is that openalpr detects the plate.
>
>
> Then run it with the -j option which will give you the plate coordinates, and use that along with the `convert` utility to automatically crop the image to the plate coordinates, and now you have a cheap & easy plate extractor.
>
>
> Then, use train-ocr to make it learn about your fonts, etc.

Hi Ajay
Have you completed the process, we need some help from you about the execution and about the training

Devendra Kumar Emmadi

unread,
Aug 29, 2018, 7:28:05 AM8/29/18
to OpenALPR
Hi All,

is this Open ALPR adopted for india?

Regards,
Deva

deepak madan

unread,
May 17, 2019, 8:46:42 AM5/17/19
to OpenALPR
Hi,

I have been working on openalpr library downloaded from github with latest cascade files, traneddate and config files from last couple of months.
I am working on Indian plates. I have been able to modify the parameters in conf files to increase the accuracy of my plate detection region which is working perfectly fine.
I am stuck at the OCR Part. Presently, the lus.traineddata is giving good results than the lin.traineddata. 
How can i improve the existing traineddata files? It can detect most of the Characters, but sometimes gives inaccurate results in cases like 1 and 7... or O and Q. 


Regards

Deepak Madan
Reply all
Reply to author
Forward
0 new messages