Skip to main content

License Plate Detector and Recognizer

Project description

License Plate Detector & Recognizer (lpdr)

:heavy_check_mark: Low code

:heavy_check_mark: Scalable

:heavy_check_mark: Easy to modify

:heavy_check_mark: Independable

License plate extractor with optical character recognition.

:arrow_forward: If you want to understand all the underlying processes please read my paper on it. :arrow_backward:

:rocket: How it works

diagram

:rocket: Installation

Use the package manager pip to install lpdr.

pip install lpdr

or

Recommended: Clone this repo for direct lpdr usage.

git clone https://github.com/szachovy/lpdr.git

Warning! Tested on Python 3.7.4

:rocket: Usage

Case 1: LPDR as a module

import lpdr

If you only want to extract license plate from an image.

lpdr.LPD().Y # returns numpy.ndarray

If you want to get license plate numbers from an image.

lpdr.LPR().output # returns string

Case 2 Recommended: LPDR as a microservice

# in main directory
python lpdr/lpdr.py [-h] [-c CAPTURE] [-i IMAGE_PATH] # returns stdout/stderr

where:

  • -h, --help show this help message and exit
  • -c CAPTURE, --capture CAPTURE Captures image from camera after run (0/1 or True/False), False by default
  • -i IMAGE_PATH, --image_path IMAGE_PATH Defines input/output path for image (relative or absolute path to the image) 'image.png' or 'image.jpg' by default

Example of CLI usage:

python lpdr/lpdr.py -c True -i image.png
# captures the picture from a given
# optical source and saves it as image.png for lpdr program execution operations.

Why it is better to use recommended choices?

You may need to personalize the settings for more specified tasks, as a python package you would first need to find the package path.

Here are the options available, you can change them as you wish.:

  • Add tesseract utility for Windows (absolute path to tesseract.exe), it sometimes causes the problems on Windows machines if you do not add it.
  • Defaults for argparser (capture / image_path)
  • Input camera source
  • Width of the image to be captured
  • Height of the image to be captured
  • Wpod-net path (or different one if you have .h5 and .json files after training)
  • IOU threshold
  • Confidence if the detected object is a license plate
  • Alpha normalization parameter
  • Confidence with plate sizing parameters
  • Loss function
  • OEM
  • PSM

Warning! Depending on the tensorflow version there might be some issues with keras. Upgrade TF to 2.0 or higher if you can.

:rocket: Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update the tests as appropriate.

:rocket: References

License Plate Detection ECCV 2018 paper Sergio Montazzolli Silva, Claudio Rosito Jung

ALPR for unconstrained scenarious

Optical Character Recognition by Open source OCR Tool Tesseract: A Case Study Chirag Patel, Atul Patel, PhD, Dharmendra Patel

An Overview of the Tesseract OCR Engine Ray Smith, Google Inc.

Wrapper for Google's Tesseract-OCR Engine.

:rocket: Author

  • Wiktor Jakub Maj

If you use lpdr in your work please cite my paper!

@article{article,
author = {Maj, Wiktor},
year = {2020},
month = {09},
pages = {1-13},
title = {Matrix operations on License Plate Detector and Recognizer (LPDR)}
}

:rocket: License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

lpdr-0.2-py3.7.egg (6.2 MB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page