HELP!!! Stuck at final step for Vietnamese 2-line detection

1,032 views
Skip to first unread message

Do Phuong Dong

unread,
Jan 19, 2016, 11:54:29 PM1/19/16
to OpenALPR

Hello everybody,


We have finished training the detector for more than 1.000 plates, and then got the XML result file (which is attached here)

But, when we reach the final command, as below

/*=================*/


alpr -c vn
/*=================*/

In the config file, we change the multiline value:

- Multiline = 1: no plates found
- Multiline = 0:


With this photo: found 75027



With this: found 59U1


So, I am asking for help on source code modification or some secrets in the training process to get the complete 2-line result.


Thank you in advance!


Do Phuong Dong

unread,
Jan 19, 2016, 11:55:52 PM1/19/16
to OpenALPR
These are my result files, please take a look at them. Thanks.
vn.conf
vn.xml

Matt

unread,
Jan 20, 2016, 9:05:15 AM1/20/16
to OpenALPR
Hey Do,

You're on the right track.  A slight tweak to the vn.conf gets the multiline working.  You need to add char_width_mm and char_height_mm again to reflect the second line.  Since they characters are both the same width/height, you can just copy and paste.  If they were different dimensions (e.g., big characters on top, small characters on bottom) you would specify that here.

plate0: 10 results
    - 9U1-5027I confidence: 86.5451
    - U1-5027I confidence: 86.0674
    - 9U1-027I confidence: 84.6141
    - U1-027I confidence: 84.1364
    - U1-5027IJ confidence: 83.6766
    - 9U1-50Z7I confidence: 82.8985
    - U1-50Z7I confidence: 82.4207
    - 9U1-S027I confidence: 82.3537
    - 9U1-027IJ confidence: 82.2233
    - U1-S027I confidence: 81.876


After changing that, it does pick up the multiline, but the results are bad because your detector is off by quite a bit.  That may be because the limited positive samples (you say you're using 1000), or it may be because the samples aren't cropped well.  I'm not sure, I'd need to see your data to help with that.  

If you run alpr with the "--debug" option, you'll see the output below.  The red boxes are what your detector thought was the license plate (notice how far off to the right of the plate it is).  The magenta box is OpenALPR's best attempt at finding the characters in the region.  It can handle a little bit of offset, but if it's only given half the plate, it will usually fail to find the full plate.

vn2.conf
Message has been deleted

Do Phuong Dong

unread,
Jan 25, 2016, 11:09:25 PM1/25/16
to OpenALPR
Thank you for your support, ALPR now can read all 2 lines of the plate, but we still have 2 more concerns:

1. On Android, is there anyway to run the command with "--debug" to display the photo with "marked place for possible license plate"? This is currently required for academic purpose.

2. There are a few mistakes when detecting "number vs character", but Vietnamese plates can only have ONE character at one exact place (the third character on the upper line). So we think it needs a specific regular expression for the 2-line plate, we have tried but can't write any correct one, can you show us the pattern for it?

Thank you in advance, it's so kind of you to devote your time supporting every researchers on the world, we hope one day ALPR will become the leading technology for license plate recognition.

Matt

unread,
Jan 26, 2016, 8:55:20 AM1/26/16
to OpenALPR
You want to see debug images in Android?  You're currently running a program in Android from the CLI?

The OpenALPR API returns the plate number and the position in the image.  You can use that data to draw on the image to produce the marked place.  I would not try and use the debug images for this purpose.

The multi-line plates support multi-line patterns.  Use a "\n" in the pattern to match against the second line.  For example:
@@@\n### would match the plate
ABC
123

but would not match
ABC1
23

Minh Hung Le

unread,
Mar 13, 2016, 12:24:09 PM3/13/16
to OpenALPR
Hi Dong,

Would you please help me step by step how to make trainig the dectector for Vietnamese plates? I'm collect data for car plates.
This is the first time I research this open source.

Thank you so much.

Hung Le

Phan Thanh Bình

unread,
Aug 17, 2016, 11:42:24 PM8/17/16
to OpenALPR
Hi guy, i come from vietnam same with Do Phuong Dong, i seen 2 files which is posted are vn.conf and vn.xml, can i use them to add into android studio? i try but notworking( i did overwrite openalpr.conf in assets folder and change name to openalpr.conf, add vn.xml file to region folder, edit parameters in code from "us" to "vn"), i seen beside these file, in this folder had .leu.traineddata file, eu.patterns file, so did i miss it and result code didn't work? Thanks.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages