JavaANPR doesn't care if the image is a plate cutout or a whole car. There are various possible issues with your approach though.
First of all, the image is way bigger than needed - it should be more than enough to resize them to 640x480, or something similar.
Secondly, you should use a correct syntax.xml
configuration. Specifically, start with something similar to this one and adjust based on your needs.
<!DOCTYPE structure SYSTEM "https://raw.githubusercontent.com/oskopek/javaanpr/master/src/main/resources/dtd/syntax.dtd">
<structure>
<type name="chile">
<char content="abcdefghijklmno0pqrstuvwxyz"/>
<char content="abcdefghijklmno0pqrstuvwxyz"/>
<char content="abcdefghijklmno0pqrstuvwxyz"/>
<char content="abcdefghijklmno0pqrstuvwxyz"/>
<char content="o0123456789"/>
<char content="o0123456789"/>
</type>
<type name="chile2">
<char content="abcdefghijklmno0pqrstuvwxyz"/>
<char content="abcdefghijklmno0pqrstuvwxyz"/>
<char content="o0123456789"/>
<char content="o0123456789"/>
<char content="o0123456789"/>
<char content="o0123456789"/>
</type>
</structure>
Thirdly, the Chile plates have a few specifics that will more or less hinder JavaANPR in correctly finding and classifying them:
- The font is different to the European ones, on which it was trained.
- The plates are quite skewed and rotated on some of your photos.
- The "CHILE" text under the plate is another thing that confuses JavaANPR.
Play around with the parameters in config.xml
, you may be able to get better results.
I was able to actually edit the images using feedback from JavaANPR's reports and get them to recognize correctly (adjusting contrast, brightness, rotation/perspective, etc). Now, that is obviously "cheating", but it may help you in getting insight into what is going wrong with your examples.
Check out the documentation on how to use reports for details.