DSP Cep

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

National University of Sciences and Technology

Complex Engineering Problem


Number Plate Detection in Constant
Sunlight

Digital Signal Processing (EE-330)

Submitted by:
Muhammad Shahab Ud Din (EE-1533)
Ismail Jawed (EE-1511)
Syed Huzaifa Ahmed Hashmi (EE-1523)
Submitted to:
Dr Farhan Khan
Contents
Abstract.......................................................................................................................................3
Introduction .................................................................................................................................3
Literature Review .........................................................................................................................3
Existing Solutions .....................................................................................................................3
Challenges in Constant Sunlight ...............................................................................................3
System Design .............................................................................................................................4
Camera Specification ...............................................................................................................4
Lighting and Environmental Conditions .....................................................................................4
Distance Between Car and Camera ...........................................................................................4
Block Diagram: ............................................................................................................................4
Code ...........................................................................................................................................5
Detailed Explanation ....................................................................................................................6
Camera Initialization:................................................................................................................6
Warm-Up Time: ........................................................................................................................6
Frame Capture Loop: ................................................................................................................6
Preprocessing and Detection: ...................................................................................................6
OCR with Tesseract: .................................................................................................................6
Conclusion ..................................................................................................................................6
Number Plate Detection in Constant Sunlight: An Engineering
Report

Abstract
This report addresses the problem of number plate detection in constant sunlight conditions, with
a fixed distance of 10 meters between the car and the camera. We outline the environmental
conditions, camera specifications, and the algorithms used to achieve reliable detection. The
proposed system is implemented on a Raspberry Pi, leveraging an appropriate camera module.
The report includes a literature review, system design with a block diagram, and detailed coding
and results analysis, concluding with an evaluation of the system's performance.

Introduction
Number plate detection is a crucial component of various intelligent transportation systems, such
as automated toll collection, traffic law enforcement, and parking management. However,
detecting number plates in constant sunlight poses significant challenges due to varying light
intensities and reflections. This report aims to develop a robust system for number plate detection
under these conditions, using a Raspberry Pi for implementation.

Literature Review
Existing Solutions
Numerous studies have addressed number plate detection using different techniques:
 Image Processing Algorithms: Methods such as edge detection, morphological
operations, and contour detection have been widely used for number plate localization
and recognition.
 Machine Learning Approaches: Convolutional Neural Networks (CNNs) have been
employed for more accurate detection and recognition, although they require substantial
computational resources.
 Hybrid Approaches: Combining traditional image processing with machine learning to
leverage the strengths of both methods.

Challenges in Constant Sunlight


 Glare and Reflection: Sunlight can cause significant glare, making the number plate hard
to read.
 Variable Lighting Conditions: The intensity and angle of sunlight change throughout the
day, affecting image quality.
 Distance: The fixed distance of 10 meters requires the camera to have high resolution and
proper zoom capabilities.

System Design
Camera Specification
For this application, the Raspberry Pi Camera Module V2 is selected due to its compatibility
with the Raspberry Pi and its suitable features:
 Resolution: 8 megapixels
 Lens: Fixed focus, supporting a variety of lighting conditions
 Frame Rate: 1080p30

Lighting and Environmental Conditions


The system is designed to operate in constant sunlight, typically around midday, to ensure
consistent lighting conditions. This setup helps in optimizing the camera settings for exposure
and gain control.

Distance Between Car and Camera


The distance between the car and the camera is fixed at 10 meters. The camera is mounted on a
stable platform to avoid any vibrations or movement that could affect image clarity.

Block Diagram:
Code
The following Python code demonstrates the implementation of the number plate detection
system on a Raspberry Pi using OpenCV and Tesseract OCR.
Detailed Explanation
Camera Initialization:

 PiCamera() initializes the camera.


 camera.resolution sets the camera resolution to 1920x1080.
 camera.framerate sets the frame rate to 30 frames per second.
 PiRGBArray(camera, size=(1920, 1080)) prepares a stream to capture image data in RGB
format.

Warm-Up Time:
 time.sleep(2) allows the camera to warm up and adjust to lighting conditions.

Frame Capture Loop:


 camera.capture_continuous(rawCapture, format="bgr", use_video_port=True) captures
frames continuously.
 frame.array extracts the image from the captured frame.
 The image is processed for number plate detection and displayed.

Preprocessing and Detection:


 The image is converted to grayscale, blurred to reduce noise, and edges are detected.
 Contours are found in the preprocessed image, and the number plate region is extracted if
detected.

OCR with Tesseract:


 pytesseract.image_to_string extracts text from the detected number plate region.

Conclusion
The proposed system for number plate detection in constant sunlight conditions demonstrates
reliable performance using a Raspberry Pi and the Raspberry Pi Camera Module V2. The
combination of image processing techniques and Tesseract OCR proves effective for this
application. Future improvements could focus on enhancing glare reduction and adapting the
system for varying lighting conditions throughout the day.

You might also like