Skip to content

sJaiswal1970/ALPR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Automatic License Plate Recognition (ALPR) System

This repository contains a complete, end-to-end Python application for detecting and recognizing vehicle license plates from images. The system is built using a combination of deep learning for object detection and a powerful OCR engine for character recognition.

Demo Image (Note: You should replace the image above with a screenshot of your final output. I suggest creating a demo folder and placing the image there.)

Features

  • License Plate Detection: Accurately localizes license plates in images using a custom-trained YOLOv8 model.
  • Character Segmentation: Implements a robust computer vision pipeline with OpenCV to isolate individual characters from the detected plate, even with varying image sizes.
  • Character Recognition: Utilizes the powerful EasyOCR engine to achieve high accuracy in reading the segmented characters.
  • Batch Processing: Automatically finds and processes all images in a designated test folder.
  • Post-Processing: Includes logic to clean the final output and remove non-alphanumeric characters for a more accurate reading.

Project Pipeline

The system operates on a three-phase pipeline:

  1. Phase 1: Localization

    • A custom-trained YOLOv8n object detection model (best.pt) is used to find the bounding box of the license plate in the input image.
    • This model was fine-tuned on a dataset of Indian license plates, making it specific to this task.
  2. Phase 2: Segmentation

    • The cropped plate image from Phase 1 is passed to a custom segmentation script.
    • The script uses OpenCV for preprocessing, including resizing to a standard height (for robustness), grayscale conversion, and Otsu's binarization.
    • Contour detection is then used to find all potential characters, which are filtered based on size and aspect ratio to isolate only the valid ones.
  3. Phase 3: Recognition

    • The segmented character data is passed to the EasyOCR engine.
    • EasyOCR, a pre-trained deep learning model, reads the text from the plate.
    • The raw output is then cleaned using a post-processing filter to yield the final license plate number.

Technology Stack

  • Language: Python 3.11+
  • Core Libraries:

Setup and Installation

Follow these steps to set up and run the project locally.

1. Prerequisites:

  • Python 3.11 or higher.
  • git for cloning the repository.

2. Clone the Repository:

git clone [Link to your GitHub Repo]
cd ALPR_Project

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages