All Projects
Machine Learning

AI-Driven License Plate Recognition System

Computer vision system that detects and extracts text from vehicle license plates using OpenCV edge detection and Tesseract OCR. Processes vehicle images to identify plate regions, highlight contours, and read alphanumeric characters automatically.

Project Overview

An end-to-end computer vision pipeline that automatically detects vehicle license plates from images and extracts the plate number using Optical Character Recognition. The system applies a multi-stage image processing pipeline, grayscale conversion, Gaussian blur, Canny edge detection, contour analysis, and ROI extraction, before passing detected regions to Tesseract OCR for text reading.

Built entirely in Python using OpenCV and pytesseract, the project demonstrates core computer vision concepts applied to a real-world automation problem: replacing manual plate reading with an automated, repeatable pipeline. The codebase is lightweight, beginner-friendly, and cross-platform, running on Windows, Linux, and macOS without GPU requirements.

The Challenge

Manual vehicle identification is slow, error-prone, and unscalable in high-traffic environments such as parking lots, toll booths, border checkpoints, and fleet management systems. Traditional ANPR (Automatic Number Plate Recognition) solutions require expensive proprietary hardware and software licences, making them inaccessible for small organisations and individual developers who need a cost-effective alternative.

The Solution

Developed a multi-stage image processing pipeline using OpenCV to isolate license plate regions through edge detection and contour filtering. Each candidate region is cropped and passed to Tesseract OCR configured in single-word mode (--psm 8) for character extraction. The pipeline is fully configurable, runs on standard hardware without a GPU, and is deployable on edge devices including Raspberry Pi for real-world use cases.

The system processes images in milliseconds, highlights detected plate contours in green for visual confirmation, and outputs extracted plate text directly to the terminal, making it easy to integrate with logging systems, databases, or web dashboards.

Key Features

  • Grayscale conversion and Gaussian blur for noise reduction before edge detection
  • Canny edge detection to identify sharp boundaries in the image
  • Contour detection and area filtering (minimum 500px²) to isolate plate-like regions
  • Region of interest (ROI) cropping for each candidate plate area
  • Tesseract OCR with --psm 8 single-word mode for accurate plate text extraction
  • Visual output with detected plate contours highlighted in green
  • Cross-platform support, Windows, Linux, macOS
  • Lightweight deployment with no GPU required
  • Easily extensible for real-time webcam or video feed processing
  • MIT licensed and fully open source

Results & Impact

Successfully detects and reads license plates from clear, well-lit vehicle images with high accuracy. The pipeline correctly isolates plate regions using contour filtering, rejecting non-plate areas below the 500px² threshold. OCR extraction performs reliably on standard plate fonts under good lighting conditions.

The project establishes a working baseline for license plate recognition that can be extended with deep learning-based plate localisation (HAAR cascade or YOLO) for improved accuracy under varied conditions. Planned improvements include real-time video processing, batch image support, image preprocessing enhancements (thresholding, deskewing), and a simple GUI for non-technical users.