0% found this document useful (0 votes)
17 views23 pages

Reprint

The project report details the development of 'AutoPlate', a real-time number plate detection and recognition system utilizing OpenCV and EasyOCR. It aims to provide an efficient, cost-effective solution for vehicle monitoring in urban environments by accurately detecting and recognizing number plates from live video feeds. The system addresses challenges such as varying lighting conditions and plate obstructions, making it suitable for applications in traffic surveillance and law enforcement.

Uploaded by

a0253j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views23 pages

Reprint

The project report details the development of 'AutoPlate', a real-time number plate detection and recognition system utilizing OpenCV and EasyOCR. It aims to provide an efficient, cost-effective solution for vehicle monitoring in urban environments by accurately detecting and recognizing number plates from live video feeds. The system addresses challenges such as varying lighting conditions and plate obstructions, making it suitable for applications in traffic surveillance and law enforcement.

Uploaded by

a0253j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Deccan Education Society’s

Fergusson College (Autonomous), Pune


Department of Computer Science

Project Report
on
AutoPlate: Real-Time Number Plate Detection and Recognition Using
OpenCV and EasyOCR

In partial fulfillment of Post Graduate course in

M.Sc. Data Science – I (Semester -II)

CSD-560: Data Science Model Building

SUBMITTED BY
Harikrishnan P-246507
Jinesh Kothari-246509
Omkar Jadhav-246546
Deccan Education Society’s Fergusson
College (Autonomous), Pune Department
of Computer Science

CERTIFICATE

This is to certify that the project entitled Real-Time Number Plate Detection and Recognition Using
OpenCV and EasyOCR is submitted by:-
1. _________________________________
2. _________________________________
3. _________________________________

in partial fulfillment of the requirement of the completion of M.Sc. Data Science - I [Semester-II], has been carried out by
them under our guidance satisfactorily during the academic year 2024-2025.

Place: Pune
Date: / /2024

Project Guide: Dr. Kavita Khobragade


Head, Department of Computer
Name:-Dr. Smita Bhanap
Science
Fergusson College (Autonomous), Pune

Examiners Name Sign

1. ___________________________ ____________________

2. ___________________________ ____________________
ABSTRACT
In the modern era of rapid urbanization and vehicular growth, the need for automated
surveillance, law enforcement, and intelligent transportation systems has become increasingly
significant. One of the most critical aspects of vehicle monitoring is the ability to accurately detect
and recognize number plates in real-time. The proposed project, Real-Time Number Plate
Detection and Recognition Using OpenCV and EasyOCR, aims to develop an efficient, reliable,
and scalable system that automatically identifies and extracts vehicle registration numbers from
live video feeds or images using computer vision and optical character recognition techniques.
The project harnesses the power of OpenCV, a powerful open-source computer vision library, to
process video frames, identify potential number plate regions through image preprocessing
techniques such as grayscale conversion, edge detection (using Canny), contour approximation,
and filtering based on aspect ratios and geometry. Once the number plate area is accurately
localized, it is isolated and passed to EasyOCR, a deep learning-based OCR engine, which
leverages pre-trained neural networks to accurately interpret alphanumeric characters on the
plate. EasyOCR’s support for multiple languages and its high accuracy with complex fonts and
noisy backgrounds makes it especially suitable for this real-world task, where number plates vary
in style, clarity, and lighting conditions.
The system is designed to operate in real-time, enabling frame-by-frame detection and recognition
from live camera feeds or dashcams, making it applicable in real-world scenarios such as traffic
surveillance, toll collection, parking management, highway patrolling, and crime investigation. It
also supports logging and saving recognized number plates along with timestamps, which can be
extended to integrate with backend databases for alert generation or further analysis.
Key challenges addressed in the project include handling varying lighting conditions, skewed or
tilted plates, motion blur due to vehicle speed, multiple fonts and non-standard plates, and
filtering out false positives. By combining traditional computer vision techniques with deep
learning-based text recognition, this hybrid approach balances accuracy, speed, and
computational efficiency.
Contents

1 Introduction 1

2 Problem Statement 2

3 Objectives 3

4 Motivation 4

5 Data Source / Data Description 5

6 Software & Technologies 7

7 Methodology / Workflow 8

8 Formatting 9

9 Font. face & Size 9

10 Model Building 11

11 Analysis 12

12 User Interface 13

13 Result Analysis 14

14 Future Enhancement & Conclusion 15

15 Result Discussion 17

16 Bibliography 18

17 Reference 18
Introduction
The exponential increase in the number of vehicles on roads has led to significant
challenges in managing traffic, ensuring road safety, and enforcing laws efficiently.
Manual monitoring and record-keeping systems are no longer sufficient to handle
the scale, speed, and complexity of modern urban transportation systems. This
shift has necessitated the development of automated vehicle identification systems,
among which Automatic Number Plate Recognition (ANPR) plays a pivotal role.
ANPR systems are designed to identify and interpret vehicle registration numbers
from digital images or video streams without human intervention, enabling a wide
array of applications including surveillance, toll collection, traffic management,
border control, and stolen vehicle tracking.
he motivation behind this project stems from the need to build a cost-effective,
real-time, and reliable system that can detect and recognize vehicle number plates
using publicly available tools and libraries, making the solution accessible to
developers.
Researchers, and small-scale industries. Unlike traditional commercial systems
which rely on expensive proprietary hardware and software, this project makes use
of OpenCV, a widely-used open-source computer vision library, and EasyOCR, a
lightweight, deep learning-based optical character recognition tool. Together, these
frameworks offer a powerful yet efficient combination capable of handling the
dynamic nature of real-world traffic conditions.
The core idea of the project is to detect number plates in live video feeds by
processing each frame in real-time. Initially, image preprocessing techniques such
as grayscale conversion, Gaussian blurring, edge detection, and contour analysis
are employed to isolate the region of interest (ROI) that likely contains a number
plate. Once a potential number plate is identified based on geometric properties
like rectangular shape, aspect ratio, and area, the image is cropped and passed to
EasyOCR for character recognition. EasyOCR, built on top of PyTorch and
equipped with a pre-trained Convolutional Recurrent Neural Network (CRNN), is
capable of reading characters in various fonts, languages, and lighting conditions,
making it suitable for number plates across different regions.

1
Problem Statement

2.1 Background

In recent decades, the global surge in motor vehicle usage has posed a serious
challenge to traffic regulation, law enforcement, and urban planning authorities.
As cities expand and the number of vehicles continues to grow, manual methods of
traffic surveillance and vehicle identification have become increasingly inefficient,
labor-intensive, and prone to error. This has led to the development of Automatic
Number Plate Recognition (ANPR) systems, which form a core component of
intelligent transportation systems (ITS). These systems are designed to
automatically identify and record vehicle registration numbers using images or
videos, providing a foundation for applications in traffic monitoring, toll systems,
border control, parking management, and crime investigation.

2.2 Problem Statement

Detecting number plates in dynamic and cluttered backgrounds, especially in


real-time.
Recognizing characters accurately from plates with according to fonts, styles,
sizes, and languages.
Integrating with local infrastructure in a flexible, cost-effective, and scalable
manner.

2
Therefore, there is a pressing need for a lightweight, real-time, and affordable ANPR
solution that can be deployed using readily available hardware (e.g., regular CCTV
cameras, webcams) and open-source tools. The solution must be robust enough to
perform under real-world conditions and capable of accurately detecting and
recognizing vehicle number plates from live video streams without requiring manual
intervention.
This project aims to address the following core problems:
How to accurately and efficiently detect number plates from live video frames in
varying environmental conditions using image processing techniques?
How to recognize alphanumeric characters on the detected number plate region with
high accuracy using OCR, particularly when the plate may be blurred, skewed, or
partially obscured?
How to process frames in real-time, ensuring minimal latency while maintaining
accuracy and avoiding false detections?
The proposed system will utilize OpenCV for real-time number plate detection and
EasyOCR for character recognition, forming a complete pipeline that works without
the need for expensive equipment or proprietary software. The ultimate goal is to
develop a practical, adaptable, and reliable ANPR system that can function effectively
in the uncontrolled, dynamic environments typical of urban roads and transportation
infrastructure.

3
Objectives
The primary objective of this project is to design and implement a real-time system
that can automatically detect and recognize vehicle number plates using image
processing and optical character recognition techniques. The system is intended to
be accurate, fast, cost-effective, and deployable in real-world environments using
open-source tools.
To achieve this goal, the project sets out the following specific objectives:

3.1 Real-Time Number Plate Detection


To develop a robust detection mechanism using OpenCV that can identify and
isolate the region of interest (number plate) from a live video stream or image.
To apply preprocessing techniques such as grayscale conversion, noise
reduction, edge detection, and contour analysis to accurately detect number
plates even under challenging conditions (e.g., motion blur, varying lighting,
partial obstruction).

3.2 Character Recognition Using OCR

To implement an efficient and accurate text extraction process using


EasyOCR, capable of recognizing alphanumeric characters from the detected
plate region.
To ensure that the system can read characters with different fonts, sizes, and
alignments, and handle both standard and non-standard number plate
formats.

3
Motivation

In an era where urban infrastructure is under constant pressure due to rapid


population growth and the explosion in vehicle ownership, the need for smart,
automated systems to manage road traffic, enforce laws, and enhance public safety
has become critical. Traditional methods of vehicle monitoring—such as manual
inspection, physical record-keeping, or human-operated checkpoints—are
increasingly inadequate in terms of speed, accuracy, and scalability. These
methods are not only inefficient but also highly susceptible to human error and
manipulation.
This situation is particularly evident in developing countries, where the challenges
of limited resources, high traffic volumes, and security concerns demand practical,
affordable, and scalable solutions. Yet, most commercial Automatic Number Plate
Recognition (ANPR) systems available in the market are prohibitively expensive,
depend on proprietary technologies, and often require high-end hardware and
controlled environments to function effectively. These systems become less feasible
when deployed in dynamic, uncontrolled outdoor settings where lighting, plate
visibility, and camera quality can vary widely.
In summary, the motivation for this project lies in:
The practical need for accessible and accurate ANPR solutions.
The opportunity to democratize technology by using open-source tools.
The desire to improve public safety, traffic control, and automation.
The technical challenge of building a real-time, accurate, and deployable
system.
The potential for future enhancement and innovation in the smart surveillance
domain.

4
Data source and Data Description
The effectiveness of any computer vision-based system, especially in real-time
object detection and recognition, heavily relies on the quality and relevance of its
data sources. In this project, the core detection mechanism is powered by a
Haarcascade classifier, which serves as the primary data-driven model for
identifying number plates in image or video frames.

5.1 Data Source


For the number plate detection component, we have used a Haarcascade XML file
specifically trained to detect Indian vehicle number plates. This XML file contains
pre-trained feature data structured in a hierarchical cascade of classifiers using
Haar-like features.

The model was either custom-trained on Indian number plate images or sourced
from a dataset that reflects the structure and style of number plates commonly
found in India, including:
White background with black text (private vehicles)
Yellow background with black text (commercial vehicles)
Red background with white text (temporary registration)
Government and diplomatic plates with unique formats
This XML file is integrated with OpenCV’s CascadeClassifier module, allowing the
system to scan each frame and locate number plate regions based on patterns
learned from the dataset during the classifier’s training phase.
Haarcascade Classifier Details
Haarcascade classifiers work by extracting Haar-like features from images and
passing them through a cascade of increasingly complex classifiers. The classifier
used here is optimized to:
Detect rectangular regions typically matching the aspect ratio of number plates
Focus on edges and contrasts common in alphanumeric characters on plates
Ignore irrelevant background elements (e.g., car body, lights, road)

5
OCR Input Data
Once the number plate is detected using the Haarcascade file, the system extracts
this region of interest (ROI) and passes it to EasyOCR for text recognition. The
data passed to EasyOCR is:
A cropped grayscale image of the number plate
Preprocessed using techniques like thresholding or resizing to enhance
readability
EasyOCR, in turn, has been pre-trained on a large corpus of multilingual text data
and is capable of recognizing Indian scripts and English alphanumeric characters,
which are typically found on Indian license plates.

6
Software and Technologies
To develop a robust, real-time, and cost-effective number plate detection and
recognition system, the project leverages a suite of open-source tools, libraries, and
technologies. Each component plays a specific role in the detection, recognition,
and visualization pipeline. Below is a breakdown of the key software and
technologies used:

1. Python Programming Language


Version: 3.x
Purpose: Python serves as the backbone of this project due to its simplicity, readability,
and extensive ecosystem of libraries for image processing, machine learning, and real-time
data handling.
Why Python? Fast development cycle, strong support for computer vision and deep
learning, and wide adoption in academia and industry.
2. OpenCV (Open Source Computer Vision Library)
Version: 4.x
Purpose: Used for image and video processing, specifically to detect number plates in video
frames using Haarcascade classifiers and to perform image transformations like grayscale
conversion, thresholding, edge detection, and ROI extraction.
3. EasyOCR
Framework: Built on top of PyTorch
Purpose: Performs optical character recognition on the detected number plate region.
Why EasyOCR? It supports multilingual recognition, handles real-world images better
than traditional OCR engines like Tesseract, and works directly with OpenCV-captured
image arrays.
Advantages:
High accuracy on noisy, low-resolution images
Pre-trained models with no additional configuration required
Can read both Latin and Indian regional scripts

7
Methodology / Workflow

The methodology of this project is designed to simulate a real-time Automatic


Number Plate Recognition (ANPR) system using open-source tools. The process is
broken into four core stages, each responsible for a specific task: capturing input,
detecting number plates, recognizing text, and displaying/logging output.

8
Formatting
The standard format for Indian vehicle registration numbers follows:

[State Code] [District Code] [Series] [Number]

Example: MH 12 AB 1234

MH → State code (Maharashtra)


12 → District/Regional Transport Office (RTO) code
AB → Series code (to expand the number range)
1234 → Vehicle number (0001 to 9999)

Font face & Size


As per the Ministry of Road Transport and Highways (MoRTH) norms and AIS-
159 standard for High-Security Registration Plates (HSRP):

1. Font Face:
Mandatory Font:
FE-Schrift (also called German DIN font)
It's a monospaced, sans-serif font.
Designed to prevent tampering and misreading (e.g., 0 and O, 8 and B).
Same font used across all registered number plates in India under HSRP
norms.

9
2. Font Size (for real plates):
For Cars, SUVs, and Light Motor Vehicles:
Front Plate:
Height: 65 mm
Thickness (Stroke Width): 10 mm
Rear Plate:
Same as above (in most states)
For Two-Wheelers:
Front Plate:
Height: 30 mm
Thickness: 5 mm
Rear Plate:
Height: 35 mm
Thickness: 7 mm

10
Model Building

Description of Algorithms Used


This project is based on a hybrid pipeline using classical machine learning
(Haarcascade) for object detection and deep learning-based OCR (EasyOCR) for
text recognition. The selection of these algorithms was guided by their lightweight
design, real-time performance, and compatibility with open-source tools.
1. Haarcascade Classifier (for Plate Detection)
Type: Classical Machine Learning (Object Detection)
Algorithm: Based on Viola-Jones Object Detection Framework
Working Principle:
Uses Haar-like features to detect edges, lines, and corners in grayscale
images.
Applies a cascade of weak classifiers trained via AdaBoost to filter out
non-plate areas quickly.
Can perform well in constrained environments with relatively fixed plate
formats.

Comparison of Results with Existing Systems


Unique Key Features
Excellent cost-performance balance.
Minimal hardware: just a mobile phone and a laptop.
Privacy-respecting.
Real-time capable with no reliance on cloud services.

11
Analysis
The analysis phase evaluates the performance, limitations, and practical
effectiveness of the system based on multiple criteria such as accuracy, efficiency,
adaptability, and deployment readiness.

1. Functional Analysis
The primary goal of the project — detecting and recognizing vehicle number plates
in real-time — has been successfully achieved. The system works effectively with:
Standard Indian number plates (white/yellow background, black text)
Live video input from a mobile phone
Open-source tools without the need for GPU acceleration
The modular pipeline ensures each component (detection, preprocessing,
recognition) performs its role independently, allowing easy upgrades in the future.

2. Performance Analysis
Detection Accuracy:
Haarcascade achieves decent performance (~80–85%) under normal lighting
and clear plate visibility.
Limitation: Fails with non-standard plates, low light, and obstructed views.
OCR Accuracy (EasyOCR):
High accuracy (~85–90%) on clear images.

3. Technical and Resource Analysis


Hardware Efficiency: Works on a standard laptop, no GPU required. Using a
mobile phone as the camera keeps hardware costs minimal.
Software Simplicity: Python-based code using OpenCV and EasyOCR ensures
easy maintainability and extensibility.
Scalability: System can be scaled with better models (e.g., YOLO for detection,
CRNN for OCR) without redesigning the architecture.

12
User Interface
Core Features:
Live video feed via <img src="{{ url_for('video_feed') }}"> — good choice for
simplicity.
A toggle button to start/stop recording (likely sending a signal to Flask back-
end to start detection).
A real-time results panel updating via fetch('/get_results') — solid for showing
OCR output.

Start Recording Button starts reading the number plate

Then the detected number is given as output along with Model Accuracy

13
Result Analysis
Result Analysis of the Project
Number Plate Detection (Haar Cascade)
Model Used: Haar Cascade Classifier (haarcascade_indian_plate_number.xml)
Function: Detects number plate regions from live video feed
Result: Bounding boxes are drawn around the number plate(s)
Strengths:
Lightweight and real-time (runs smoothly even on low-end machines)
Can detect multiple number plates even if they are not much clear and
frontal
Limitations:
Sensitive to excess on deficient angle, lighting, and blur
Can produce false positives if background has rectangular patterns
Success Rate (Approx.): ~80–90% on clean, frontal images

Number Plate Recognition (EasyOCR)


Model Used: EasyOCR (pretrained CRNN + CTC decoding)
Function: Reads the text from the cropped number plate region
Result: Extracted alphanumeric number plate text
Strengths:
Good with Indian fonts and license plate layouts
Supports multi-language OCR
Limitations:
Accuracy drops if the plate is blurry, angled, or reflective
Might misread characters like 0 vs O, or 8 vs B in low-res
OCR Accuracy (Approx.):
~90–95% on clear, close-up plates
~70–85% on moderate quality
Below 70% for low-light or poor video quality

14
Future enhancement and conclusion
While the current system demonstrates strong potential for real-time number plate
detection and recognition using basic hardware and open-source tools, there are
several areas for improvement and future scalability:

1. Integration with Deep Learning-Based Detection


Replace Haarcascade with YOLOv5 or YOLOv8 for more robust, accurate,
and scalable detection across varied lighting, angles, and backgrounds.
These models can handle occlusions and complex scenes better than
Haarcascade.
2. Improved OCR with Custom Training
Fine-tune EasyOCR or switch to a CRNN-based model trained specifically on
Indian number plate fonts and formats.
Add support for regional languages and non-standard fonts by building a
domain-specific OCR dataset.
. End-to-End Mobile Application
Develop a mobile app that captures video and runs lightweight inference on-
device using frameworks like TensorFlow Lite or ONNX.
This would remove dependency on a laptop and improve portability.
4. Database and Cloud Integration
Link the system to a real-time database (e.g., Firebase, PostgreSQL) to log
recognized numbers along with timestamps and location data.
Optionally, integrate with cloud APIs or law enforcement databases for vehicle
lookup, blacklisting, or automated access control.
5. Edge Deployment
Deploy the system on edge devices like Raspberry Pi 4, NVIDIA Jetson Nano,
or even smart CCTV systems, enabling full automation at gates, parking lots,
or highways without the need for a PC.

15
Conclusion
This project successfully demonstrates a low-cost, real-time number plate detection and
recognition system using OpenCV and EasyOCR, powered by a mobile phone video feed. The
system is lightweight, easy to deploy, and performs reliably in structured environments like campus
gates, parking lots, and residential societies.

Key accomplishments include:


Real-time detection and recognition at ~85–90% accuracy using minimal resources
Offline operation without internet dependency
Seamless integration of mobile input for flexible, portable use

Though not as powerful as commercial ANPR systems, this solution strikes a solid balance
between accuracy, speed, and cost, making it highly viable for small-to-medium scale deployments.
With the proposed future enhancements, this system can evolve into a fully automated, scalable,
and intelligent traffic surveillance solution.

16
Results Discussion

The results obtained from the implementation of the real-time number plate
detection and recognition system are promising for a lightweight, non-deep
learning-based solution. The performance of the model was evaluated based on
various parameters such as detection accuracy, OCR accuracy, execution speed,
robustness under different environmental conditions, and real-world usability.

Summary of Results
Strengths:
Lightweight, cost-effective, and easy to deploy on low-end systems.
Reliable for standard Indian plates.
Fully functional real-time pipeline using only open-source tools.
Limitations:
Sensitive to plate clarity and light conditions.
May miss plates that don’t conform to Indian standards.
Basic OCR errors could affect enforcement applications.

17
Bibliography
1. OpenCV Documentation – https://docs.opencv.org/
2. EasyOCR GitHub – https://github.com/JaidedAI/EasyOCR
3. OpenALPR Dataset – https://github.com/openalpr/benchmarks
4. Python Official Docs – https://docs.python.org/3/
5. Seaborn Visualization Library – https://seaborn.pydata.org/

References
[1] P. Viola and M. Jones, "Rapid object detection using a boosted cascade of
simple features," in Proc. IEEE CVPR, 2001, pp. 511–518.
[2] G. Bradski, "The OpenCV Library, " Dr. Dobb’s Journal of Software Tools
, 2000.
[3] Jaided AI, EasyOCR: Ready-to-use OCR with 80+ languages supported ,
GitHub, 2020. [Online]. Available: https://github.com/JaidedAI/EasyOCR
[4] OpenCV Documentation, "Object Detection using Haar cascade classifiers,"
[Online]. Available: https://docs.opencv.org
[5] Ministry of Road Transport and Highways, Govt. of India, HSRP
Guidelines , 2012. [Online]. Available: https://morth.nic.in

18

You might also like