Skip to content

10anshika/Automatic-license--plate-recognition-system

Repository files navigation

ANPR License Plate Recognition System 🚗

Python OpenCV EasyOCR

An intelligent Automatic Number Plate Recognition (ANPR) system that detects and extracts license plate text from vehicle images using computer vision and deep learning techniques. Built with OpenCV for image processing and EasyOCR for optical character recognition.

🎯 Features

  • Real-time Processing: Fast license plate detection and recognition (~0.3 seconds per image)
  • Computer Vision Pipeline: Advanced image preprocessing with edge detection and contour analysis
  • OCR Technology: Accurate text extraction using EasyOCR with deep learning models
  • Robust Detection: Handles various lighting conditions and plate orientations
  • Easy Integration: Simple function-based API for seamless integration
  • Jupyter Notebook: Interactive development environment with step-by-step implementation

🚀 Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip package manager
  • (Optional) CUDA-compatible GPU for faster processing

Installation

  1. Clone the repository

    git clone https://github.com/10anshika/Automatic-license--plate-recognition-system.git
    cd Automatic-license--plate-recognition-system
  2. Install dependencies

    pip install -r requirements.txt
  3. Run the Jupyter notebook

    jupyter notebook ANPR_PROJECT.ipynb

💻 Usage

Basic Usage

import cv2
import easyocr

# Initialize the ANPR system
reader = easyocr.Reader(['en'])

# Recognize license plate from image
def recognize_plate(image_path):
    # Load and process image
    img = cv2.imread(image_path)

    # Your license plate detection logic here
    # (See full implementation in ANPR_PROJECT.ipynb)

    return detected_text

# Example usage
result = recognize_plate('path/to/your/car_image.jpg')
print(f"Detected License Plate: {result}")

Advanced Features

The system includes several preprocessing steps for better accuracy:

  • Image Resizing: Automatically scales large images for optimal processing
  • Bilateral Filtering: Reduces noise while preserving edges
  • Canny Edge Detection: Identifies potential plate boundaries
  • Contour Analysis: Filters candidates based on aspect ratio and size
  • ROI Extraction: Focuses OCR on likely plate regions

🛠️ System Architecture

Input Image → Preprocessing → Edge Detection → Contour Analysis → 
ROI Extraction → OCR Processing → Text Recognition → Output

Key Components:

  1. Image Preprocessing: Grayscale conversion, noise reduction, edge enhancement
  2. Plate Localization: Contour detection with geometric filtering
  3. Text Extraction: EasyOCR-based character recognition
  4. Performance Optimization: Efficient processing pipeline

📊 Performance

  • Processing Speed: ~0.3 seconds per image (CPU)
  • Accuracy: High accuracy on clear, well-positioned plates
  • Supported Formats: JPG, PNG, BMP, TIFF
  • GPU Acceleration: Optional CUDA support for faster processing

📁 Project Structure

Automatic-license--plate-recognition-system/
├── ANPR_PROJECT.ipynb              # Main implementation notebook
├── Automatic-License-Plate-Recognition-System.pptx  # Project presentation
├── requirements.txt                # Python dependencies
├── README.md                      # Project documentation
├── images/                        # Sample images (optional)
│   └── sample_cars/
└── results/                       # Output examples (optional)
    └── detected_plates/

🔧 Configuration

System Requirements

  • RAM: Minimum 4GB, 8GB recommended
  • Storage: 2GB free space for dependencies
  • CPU: Multi-core processor recommended
  • GPU: NVIDIA GPU with CUDA support (optional)

Customization Options

# Adjust detection parameters
PLATE_WIDTH_MIN = 80    # Minimum plate width
PLATE_HEIGHT_MIN = 20   # Minimum plate height
ASPECT_RATIO_MIN = 2    # Minimum width/height ratio
ASPECT_RATIO_MAX = 6    # Maximum width/height ratio

📈 Results & Examples

Sample Detection Output:

Input: Cars82.png
Detected License Plate Text: UP46 IClJeo
Total processing time: 0.278 seconds

Performance Metrics:

  • Detection Rate: 85-95% on clear images
  • Processing Speed: 0.2-0.5 seconds per image
  • Memory Usage: ~500MB during processing

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Areas for Improvement:

  • Support for multiple languages
  • Real-time video processing
  • Mobile app integration
  • Cloud deployment options

🙏 Acknowledgments

  • OpenCV team for computer vision tools
  • EasyOCR developers for OCR capabilities
  • PyTorch team for deep learning framework
  • Google Colab for development environment
  • Inspiration from automotive security applications

📞 Contact & Support

Author: Anshika Mishra
GitHub: @10anshika Project Link: ANPR System

For support, please open an issue in the GitHub repository or contact the maintainer.


🔖 Keywords

computer-vision opencv ocr license-plate-recognition anpr deep-learning image-processing easyocr python jupyter-notebook automotive security


⭐ Star this repository if you found it helpful!

About

ANPR License Plate Recognition System: An automated license plate detection and recognition system using OpenCV for image processing and EasyOCR for optical character recognition. This Python-based solution processes vehicle images to identify and extract license plate text with real-time performance optimization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors