SandroMachado / openalpr-android

Android Automatic License Plate Recognition library (http://www.openalpr.com) ported for android.
Apache License 2.0
770 stars 272 forks source link

Portuguese / European license plates recognition #51

Closed jzeferino closed 6 years ago

jzeferino commented 7 years ago

Hi there, im running the sample and I changed the:

String result = OpenALPR.Factory.create(MainActivity.this, ANDROID_DATA_DIR).recognizeWithCountryRegionNConfig("us", "", destination.getAbsolutePath(), openAlprConfFile, 10);

to

String result = OpenALPR.Factory.create(MainActivity.this, ANDROID_DATA_DIR).recognizeWithCountryRegionNConfig("eu", "", destination.getAbsolutePath(), openAlprConfFile, 10);

But it can't detect any plates. What am I missing?

SandroMachado commented 7 years ago

Hi @jzeferino,

You need to add the country in the second field of the method recognizeWithCountryRegionNConfig. Change your code to:

String result = OpenALPR.Factory.create(MainActivity.this, ANDROID_DATA_DIR).recognizeWithCountryRegionNConfig("eu", "pt", destination.getAbsolutePath(), openAlprConfFile, 10);

Please let me know if that works.

jzeferino commented 7 years ago

Thank you for the reply @SandroMachado.

I've tested with String result = OpenALPR.Factory.create(MainActivity.this, ANDROID_DATA_DIR).recognizeWithCountryRegionNConfig("eu", "pt", destination.getAbsolutePath(), openAlprConfFile, 10); and i'm taking photos with the fone from my monitor and I was unable to make it work. Not even one license plate.

Im using samsung galaxy edge 6.

You can try with this for example.

SandroMachado commented 7 years ago

Using the demo app, I am getting this results:

baconnjh47bsandromachado06292017004251

jzeferino commented 7 years ago

@SandroMachado it still misses the 27 but, its better than here. What did you changed in the sample?

SandroMachado commented 7 years ago

What I said before:

String result = OpenALPR.Factory.create(MainActivity.this, ANDROID_DATA_DIR).recognizeWithCountryRegionNConfig("eu", "pt", destination.getAbsolutePath(), openAlprConfFile, 10);

So probably you are missing other thing, like correctly linking the library. What is the value of the response?

jzeferino commented 7 years ago

@SandroMachado I just cloned the repo and run the sample with that changes above.

SandroMachado commented 7 years ago

I have no ideia why it does not work. Don't you get any error? Just an empty set of results?

jzeferino commented 7 years ago

@SandroMachado i'm getting the toast saying that nothing can be detected.

arnoldcoder commented 7 years ago

Hi! I managed to make the sample application work, but some plate numbers have changed in Romania. The "default format" is "XX XX XXX" but since there are so many cars that the last 5 characters were not enough, there are also "XX XXX XXX". (the middle section from 2 to 3 digits). For ex: BH 09 KSR and BH 121 KSR. Could somebody help me to modify the configuration file?

There is only one situation when there is only one first character instead of 2, the capital of Romania, which is "B" as you can see on the image below

screenshot_2017-07-25-12-40-32 1 Thank you!

jzeferino commented 7 years ago

@arnoldcoder can you share what did you changed in the sample to make it work?

arnoldcoder commented 7 years ago

I created a new android project, and followed the instructions from the project page. (adding dependencies in build.gradle, etc..) Then I copied the sample project's mainActivity and layout, resources, did the changes in AndroidManifest too... (pm your email, and I'll send you the code)

jzeferino commented 7 years ago

@arnoldcoder is better to create a public repo for everyone interested.

wilsonhws commented 7 years ago

@arnoldcoder Can you explain how to import the library?

arnoldcoder commented 7 years ago

Have you added the WRITE_EXTERNAL_STORAGE permission to the Manifest file? Here is my demo project

https://www.dropbox.com/s/920i716rgv2yud4/licence.zip?dl=0

SandroMachado commented 6 years ago

I think the issue is resolved. Please let me know if something changes.