Localizing JavaAnpr for local license plates

一曲冷凌霜 提交于 2019-12-05 09:50:00

问题


I am working with JavaAnpr to automatically recognize license plates. While it works well with European license plates, it doesn't with my country. For example;

How could I edit the recourse files and syntax XML to support other countries?


回答1:


@michel_layyous - Here's the documentation by the author. Read Page 57: http://javaanpr.sourceforge.net/anpr.pdf

syntax.xml is essentially a regex file.

Using this page as an example: https://code.google.com/p/android-anpr/source/browse/trunk/res/raw/syntax.xml?r=21

<type name="russia">
   <char content="abcehkmoptxy"/>
   <char content="0123456789"/>
   <char content="0123456789"/>
   <char content="0123456789"/>
   <char content="abcehkmoptxy"/>  
   <char content="abcehkmoptxy"/>
   <char content="0123456789"/>
   <char content="0123456789"/>
</type>

This Russian license plate pattern is 8 characters. The first character can be any of those letters. The next 3 characters can be any number from their respective set. The next 2 characters can be any of those letters from their respective set, and the last 2 characters can be any of those letters from their respective set.

The next Russian license plate is just like the first Russian license plate, except one key difference:

<type name="russia2">
   <char content="abcehkmoptxy"/>
   <char content="0123456789"/>
   <char content="0123456789"/>
   <char content="0123456789"/>
   <char content="abcehkmoptxy"/>  
   <char content="abcehkmoptxy"/>
   <char content="012"/>
   <char content="0123456789"/>
   <char content="0123456789"/>
</type>

The 6th character can only be a 0, 1, or 2.

I also found a relevant blurb on this page: http://www.mp3car.com/software-and-software-development/124529-automatic-number-plate-recognition-anpr-3.html

I found a very similar license plate for your country, however it consists of two rows. The first two numbers are on the top row, and there are 5 numbers on the bottom row. It looks like your country has 7 digits for your particular style of plate. I don't how the dot factors into the recognition of your plate, however, Page 58 of the author's documentation states:

The correction of a plate means the replacement of each invalid character by another one. If the character ( ) i p at the i th position of the plate P does not match the selected pattern ( ) ` sel P , it will be replaced by the first valid one from ( ) s y . ( ) s y is a sorted vector of output activities denoting how much the recognized character is similar to an individual character from the alphabet. Heuristic analysis of a segmented plate can sometim es incorrectly evaluate non-character elements as characters. Acceptance of the non-chara cter elements causes that the recognized plate will contain redundant characters. Redundant characters occur usually on sides of the plate, but rarely in the middle. If the recognized plate number is longer than the l ongest syntax pattern, we can select the nearest pattern, and drop the redundant characters according to it.




回答2:


Check out OpenALPR (http://www.openalpr.com). It has better support across various countries. The library is written in C++ (as opposed to Java) but that should be easy to hook up using JNI.



来源:https://stackoverflow.com/questions/15596684/localizing-javaanpr-for-local-license-plates

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!