This project implements a License Plate Recognition (LPR) system using classical computer vision techniques and OCR. It detects vehicle license plates from images, segments individual characters, and recognizes the plate number using Tesseract OCR.
The system demonstrates an end-to-end pipeline for traffic management and vehicle monitoring applications.
- License Plate Detection: Detects rectangular license plates using edge detection and contour analysis.
- Character Segmentation: Extracts individual characters from detected plates using thresholding and morphological operations.
- Character Recognition: Recognizes segmented characters using Tesseract OCR with alphanumeric whitelist.
- End-to-End Pipeline: Integrates detection, segmentation, and recognition for automated plate reading.
- Visualization: Optional visualization of detected plates and segmented characters for debugging and demonstration.
- Clone the repository:
git clone <repo_link>
cd lpr- Install dependencies:
pip install opencv-python numpy pytesseract
- Tesseract OCR: Download and install Tesseract OCR and set the path in char_recognition.py:
pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"- Run the full pipeline on your dataset:
python main.pyDetected plate numbers will be printed in the console.
Dataset: https://www.kaggle.com/datasets/andrewmvd/car-plate-detection