Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font types #1

Closed
feldrim opened this issue May 7, 2016 · 2 comments
Closed

Font types #1

feldrim opened this issue May 7, 2016 · 2 comments

Comments

@feldrim
Copy link

feldrim commented May 7, 2016

Fonts.com has a nice article about font type classifications. There are 4 categories with 17 sub-categories, which only some of them are used in license plates. So the types you may consider are can be these below.

Serif Type Styles: Slab Serif.
Sans Serif Type Styles: All four of them.
Script Type Styles: None.
Decorative: None.

So there are 5 types of fonts to keep in mind. You may consider searching all the states about which is a more specific method. Or, you may consider training the AI with at least 5 types of each 5 classes mentioned above, which is simpler and universial hack.

I tihnk this might be a simple (but not exact) solution for the 2nd drawback in your conclusion.

@matthewearl
Copy link
Owner

It shouldn't be too hard to implement this: I'm imagining we'd have a fonts/ folder, and then gen.py would just load all fonts into an array and randomly select one at generation time.

There is one possible complication that I can see: The current code has very basic kerning: Each character is individually rendered into its own image ahead of time, and then these images are then tiled horizontally. This scheme works well enough for the UK number plate font, but it might not work so well for other fonts. A better solution might be to directly render the full license for each image with PIL.ImageDraw.text().

@matthewearl
Copy link
Owner

I've had some success with using the following set of fonts:

The fonts were chosen somewhat arbitrarily from the Font Squirrel lists of slab serif and sans serif fonts.

With these fonts the system seems able to read UK number plates (even though the UK number plate font wasn't provided). This means it is able to generalize to other fonts, and may be able to read non-UK number plates, however #6 will need fixing before this is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants