Coder Social home page Coder Social logo

easyocrgen's Introduction

EasyOCRGenerator

EasyOCRGenerator is a tools to generate OCR dataset for optical character recognition.

Generator

  1. Malaysia license plate
  2. Philippine license plate (TODO)
  3. English words (TODO)
  4. Non lexicon words

Imitator

  1. Malaysia license plate

Image augmentation

  1. Perspective Transformation
  2. Color Inversion
  3. Salt & Pepper
  4. Singularity: Double line plate Slicer

Notebook

There are logic behind this generator is briefly describe in TightPlateGeneration.ipynb. Singularity research is unfinished.

Dependencies

  • OpenCV
  • numpy
  • imgaug
  • pillow
  • argparse

Malaysia License Plate

Road Transport Department Malaysia (JPJ) issues various plate layout as below:

Type Layout
Private & commercial vehicles ABC 1234 or W/Q/SAB 4567 C
Taxi HAB 1234
Military ZA 1234
KL (Transition) W 1234 A
Diplomatic corps 12-34-DC
Royal & government (Full title)

Random Plate Generation

This will generate Malaysia plate with the proportion of each plate type stated below:

Layout Proportion
Priv & Comm, Taxi, Military, KL 85%
Diplomatic corps 10%
Special Plate 5%
Limousine 1%

Please to be reminded the proportion is not based on empirical study but an assumption made for training a good OCR model, that is different plate layout with balance character distribution.

Code

Arguments

  • --number Total number plate to generate. Integer
  • --mode Generation mode. Use my_plate
  • --pers_trans Perspective Transform. On / Off
  • --augment Augmentation. On / Off
  • --single_line Singularity. On / Off
  • --save_dir Directory to save images. Full path directory, Include "/" at EOL

Example

python3 generator.py --number 1000 --mode my_plate --pers_trans on --augment on --single_line on --save_dir /home/user/my_plate/

Plate Imitator

This will read the real license plate image with groundtruth as file name and generate the synthetic version of them.

Code

Arguments

  • --imitatee_dir Directory to real plate image. Full path directory, Include "/" at EOL
  • --pers_trans Perspective Transform. On / Off
  • --augment Augmentation. On / Off
  • --single_line Singularity. On / Off
  • --save_dir Directory to save images. Full path directory, Include "/" at EOL

Example

python3 imitator_my_plate.py --imitatee_dir /home/user/real_plate/ --pers_trans on --augment on --single_line on --save_dir /home/user/my_plate/

TODO

  • Lexicon Word Font & background -> license plate style
  • Non lexicon word generation
  • Philippine Plate

SideNote

  • Singularity research using image processing is not robust at the moment. Fall back to image ratio method.
  • Double line license plate generation is blocked now

easyocrgen's People

Contributors

choonkiattay avatar

Watchers

 avatar  avatar

Forkers

brahimbellahcen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.