Skip to main content

A Python library for license plate detection and recognition

Project description

PlateRecognizePy

PlateRecognizePy is a Python library for license plate detection and recognition, with special support for Indian number plates. It provides a simple interface to process images containing license plates and extract the plate text.

Features

  • License plate detection in images
  • Text recognition from license plates
  • Support for both Tesseract OCR and EasyOCR
  • Automatic saving of original and processed images
  • Logging of detection and recognition results
  • Specialized support for Indian number plates:
    • Recognition of both white and yellow plates
    • Handling of various Indian state codes
    • Support for both new and old format Indian plates

Installation

You can install PlateRecognizePy using pip:

pip install PlateRecognizePy

Requirements

PlateRecognizePy requires Python 3.7 or later. The main dependencies are:

For a complete list of dependencies, please refer to the setup.py file.

Usage

Here's a simple example of how to use PlateRecognizePy:

from plate_recognize_py import process_license_plate
import cv2

# Load an image
image = cv2.imread('path/to/your/image.jpg')

# Process the image
license_plate, text = process_license_plate(image)

print(f"Detected license plate: {text}")

Indian Number Plate Recognition

PlateRecognizePy is optimized for Indian number plates:

from plate_recognize_py import process_indian_license_plate
import cv2

# Load an image with an Indian number plate
image = cv2.imread('path/to/indian_plate_image.jpg')

# Process the image
license_plate, text, state = process_indian_license_plate(image)

print(f"Detected license plate: {text}")
print(f"State: {state}")

This function works for both white and yellow Indian number plates, automatically detecting the plate color and adjusting the recognition process accordingly.

Indian Number Plate Formats

PlateRecognizePy supports various Indian number plate formats:

  1. New Format: AA 00 AA 0000 Example: DL 01 CA 1234

  2. Old Format: AA AA 0000 Example: MH 12 3456

  3. Commercial Vehicle Format: AA 00 A 0000 Example: HR 55 C 7890

The library automatically detects the format and processes it accordingly.

Supported Indian State Codes

PlateRecognizePy recognizes all Indian state codes, including but not limited to:

  • DL: Delhi
  • MH: Maharashtra
  • KA: Karnataka
  • TN: Tamil Nadu
  • UP: Uttar Pradesh

Contributing

Contributions to PlateRecognizePy are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • OpenCV for image processing capabilities
  • Tesseract and EasyOCR for text recognition

PlateRecognizePy is developed by VJ. For any questions or support, please open an issue on the GitHub repository.

Performance and Accuracy

PlateRecognizePy has been tested on a wide range of Indian number plates, including:

  • High-resolution images
  • Low-light conditions
  • Angled or skewed plates
  • Partially obscured plates

In optimal conditions, the library achieves an accuracy rate of over 95% for Indian plates.

Limitations

While PlateRecognizePy performs well in most scenarios, users should be aware of some limitations:

  • Extremely blurry or low-resolution images may yield inaccurate results
  • Severely damaged or heavily customized plates might not be recognized correctly
  • The library may struggle with non-standard fonts or highly stylized plates

Future Improvements

We are continuously working to improve PlateRecognizePy, with planned enhancements including:

  • Support for more international

Project details


Download files

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

Source Distribution

PlateRecognizePy-0.1.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

PlateRecognizePy-0.1.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file PlateRecognizePy-0.1.2.tar.gz.

File metadata

  • Download URL: PlateRecognizePy-0.1.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for PlateRecognizePy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3edaa1473b139e191409cb2d797df7ffa0852e51281bb78bf07376868ada47bd
MD5 966de06c7b82303ce85725c57d7f8f8b
BLAKE2b-256 6a828c51aa82192d7c1631a9bb934efa2be4d95ae7bc6e20af55dfb067fd4668

See more details on using hashes here.

File details

Details for the file PlateRecognizePy-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for PlateRecognizePy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f7a9e76bd791a083efcf2c39a999c172ac6a6ba644ec39266b43f5b92b986a0
MD5 2f9fc8bd2cdc38b6bcc2b0466c70bf35
BLAKE2b-256 cc3bca66036dc0fbd5c13baf15780a17d0f98464943d239271f528e14ffed0ba

See more details on using hashes here.

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