0% found this document useful (0 votes)
23 views

Report-Real-Time Fake Number Plate Detection and Analysis With Raspberry Pi and Deep Learning

Uploaded by

vijaysagarb17
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Report-Real-Time Fake Number Plate Detection and Analysis With Raspberry Pi and Deep Learning

Uploaded by

vijaysagarb17
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 47

REAL-TIME FAKE NUMBER PLATE DETECTION AND

ANALYSIS WITH RASPBERRY PI AND DEEP LEARNING


Abstract:

This project introduces a cutting-edge system for real-time fake number plate detection and analysis,
leveraging the capabilities of Raspberry Pi and deep learning technology. The proposed solution
employs state-of-the-art deep learning algorithms to identify and flag counterfeit number plates in
real-time. The integration with Raspberry Pi facilitates efficient on-board processing, making the
system suitable for deployment in various settings. The project aims to enhance security and law
enforcement efforts by automating the detection of fraudulent number plates, contributing to
improved traffic monitoring and ensuring the integrity of license plate recognition systems. Through
the synergy of Raspberry Pi and deep learning, this innovative approach presents a robust solution
for addressing concerns related to counterfeit number plates in a timely and effective manner.

Objective:

The primary objective of this innovative system is to develop a sophisticated and efficient solution
for the rapid and accurate identification of two-wheeler license plates. Utilizing advanced techniques
such as connected component analysis and template matching, the system is designed for seamless
operation under diverse environmental conditions, with a specific emphasis on achieving high-speed
recognition during daylight. The overarching goals include enhancing accuracy and efficiency in
character identification, thereby facilitating applications like automatic toll collection, traffic law
enforcement, parking lot access control, and road traffic monitoring. Focusing on low complexity
and time efficiency, the system aims to improve overall performance by incorporating Artificial
Intelligence for advanced character recognition and authentication against an extensive database of
number plates.

Introduction:

The introduction of this innovative system represents a significant technological leap, ushering in
advancements for the accurate and rapid identification of two-wheeler license plates. Through the
integration of advanced techniques like connected component analysis and template matching, the
system aims to seamlessly operate under diverse environmental conditions, with a specific emphasis
on achieving high-speed recognition, especially in daylight scenarios. This groundbreaking solution
bears substantial implications for practical applications, including automatic toll collection, traffic
law enforcement, parking lot access control, and road traffic monitoring. By harnessing the power of
Artificial Intelligence, the system elevates character identification, authentication processes, and
overall efficiency, solidifying its status as a cutting-edge solution in the domain of detection.

PROBLEM STATEMENT:

1. Counterfeit number plates pose a significant challenge to law enforcement agencies and
traffic management systems, leading to potential security breaches, traffic violations, and
revenue loss.

2. Existing methods for number plate detection and analysis often lack the speed, accuracy, and
adaptability required to effectively identify fake number plates, particularly in real-time and
under varying environmental conditions.

3. Traditional approaches to number plate recognition may struggle with the complexities of
two-wheeler license plates, which are smaller in size and exhibit diverse fonts and styles.

4. Manual inspection of number plates is time-consuming, labor-intensive, and prone to errors,


necessitating an automated solution for efficient detection and analysis.

5. The absence of robust systems for real-time fake number plate detection hampers efforts to
enhance traffic monitoring, automate toll collection, and enforce traffic regulations
effectively.

Existing system:

The existing system typically relies on conventional image processing techniques for license plate
identification. These methods involve preprocessing steps, such as image enhancement and
thresholding, followed by segmentation and character recognition algorithms. However, these
traditional approaches may encounter challenges in accurately handling diverse environmental
conditions and ensuring high-speed recognition. The limitations often include sensitivity to
variations in lighting, font styles, and plate sizes, which can impact overall system performance.
Additionally, the reliance on rule-based algorithms may result in reduced adaptability to complex
real-world scenarios, limiting the efficiency and accuracy of license plate recognition in practical
applications.
Disadvantages:

● Sensitivity to Environmental Variations:

Traditional ANPR systems may struggle with variations in lighting conditions, making them
less robust and accurate under diverse environments such as varying daylight, shadows, or
adverse weather conditions.

● Limited Adaptability:

Rule-based algorithms utilized in the existing systems may lack adaptability to different font
styles, plate sizes, and other variations commonly found in license plates. This limitation
hinders the system's ability to handle a wide range of scenarios.

● Complex Preprocessing Steps:

The preprocessing steps, including image enhancement and thresholding, can be complex
and computationally intensive, leading to potential delays in the recognition process and
impacting the system's overall speed.

● Inefficient Character Segmentation:

The segmentation of characters from license plates may not be efficient in traditional
systems, especially when dealing with non-standard fonts, distorted characters, or crowded
backgrounds, resulting in suboptimal character recognition.

Proposed system:

The proposed system utilizing Artificial Intelligence introduces a novel approach to address the
limitations of traditional systems. Leveraging advanced AI techniques, including deep learning and
neural networks, the system aims to enhance adaptability and accuracy in license plate identification
under diverse environmental conditions. The model integrates connected component analysis and
template matching, facilitating efficient character segmentation and recognition. By utilizing AI for
feature extraction and learning, the proposed system enhances its capability to adapt to varying font
styles, plate sizes, and environmental factors, ultimately improving overall accuracy and high-speed
recognition. The incorporation of a comprehensive database and advanced algorithms for
authentication ensures robust verification against recognized number plates, marking a significant
advancement in ALPR technology.

Advantages:

● Improved Accuracy:

Integration of Artificial Intelligence, including deep learning and neural networks, enhances
the system's accuracy in identifying license plates, reducing errors associated with variations
in lighting, font styles, and plate sizes.

● Enhanced Adaptability:

The use of AI allows the system to dynamically adapt to diverse environmental conditions,
making it more robust in scenarios with changing daylight, shadows, or adverse weather
conditions.

● Efficient Character Segmentation:

The proposed model employs advanced techniques such as connected component analysis
and template matching, streamlining character segmentation and improving the overall
efficiency of the recognition process.

● High-Speed Recognition:

Leveraging AI for feature extraction and learning enables the system to achieve high-speed
recognition, making it well-suited for scenarios with fast-moving traffic and time-sensitive
applications.

Block diagram:

Software:
Hardware:
IMAGE PROCESSING DOMAIN INTRODUCTION:
DIGITAL IMAGE PROCESSING

The identification of objects in an image and this process would probably start
with image processing techniques such as noise removal, followed by (low-level)
feature extraction to locate lines, regions and possibly areas with certain textures.
The clever bit is to interpret collections of these shapes as single objects, e.g.
cars on a road, boxes on a conveyor belt or cancerous cells on a microscope slide.
One reason this is an AI problem is that an object can appear very different when
viewed from different angles or under different lighting. Another problem is deciding
what features belong to what object and which are background or shadows etc. The
human visual system performs these tasks mostly unconsciously but a computer
requires skilful programming and lots of processing power to approach human
performance. Manipulation of data in the form of an image through several possible
techniques. An image is usually interpreted as a two-dimensional array of brightness
values, and is most familiarly represented by such patterns as those of a photographic
print, slide, television screen, or movie screen. An image can be processed optically
or digitally with a computer.

1. Basics of Image Processing:-


FUNDAMENTALS OF DIGITAL IMAGE

1.1 IMAGE:

An image is a two-dimensional picture, which has a similar appearance to some


subject usually a physical object or a person.

Image is a two-dimensional, such as a photograph, screen display, and as well


as a three-dimensional, such as a statue. They may be captured by optical devices—
such as cameras, mirrors, lenses, telescopes, microscopes, etc. and natural objects and
phenomena, such as the human eye or water surfaces.

The word image is also used in the broader sense of any two-dimensional
figure such as a map, a graph, a pie chart, or an abstract painting. In this wider sense,
images can also be rendered manually, such as by drawing, painting, carving,
rendered automatically by printing or computer graphics technology, or developed by
a combination of methods, especially in a pseudo-photograph.

Fig: Colour image to Gray scale Conversion Process


An image is a rectangular grid of pixels. It has a definite height and a definite width
counted in pixels. Each pixel is square and has a fixed size on a given display.
However different computer monitors may use different sized pixels. The pixels that
constitute an image are ordered as a grid (columns and rows); each pixel consists of
numbers representing magnitudes of brightness and color.

Fig: Gray Scale Image Pixel Value Analysis

Each pixel has a color. The color is a 32-bit integer. The first eight bits
determine the redness of the pixel, the next eight bits the greenness, the next eight bits
the blueness, and the remaining eight bits the transparency of the pixel.

Fig: BIT Transferred for Red, Green and Blue plane (24bit=8bit red;8-bit
green;8bit blue)

IMAGE FILE SIZES:

Image file size is expressed as the number of bytes that increases with the number of
pixels composing an image, and the color depth of the pixels. The greater the number
of rows and columns, the greater the image resolution, and the larger the file. Also,
each pixel of an image increases in size when its color depth increases, an 8-bit pixel
(1 byte) stores 256 colors, a 24-bit pixel (3 bytes) stores 16 million colors, the latter
known as true color.Image compression uses algorithms to decrease the size of a file.
High resolution cameras produce large image files, ranging from hundreds of
kilobytes to megabytes, per the camera's resolution and the image-storage format
capacity. High resolution digital cameras record 12 megapixel (1MP = 1,000,000
pixels / 1 million) images, or more, in true color. For example, an image recorded by
a 12 MP camera; since each pixel uses 3 bytes to record true color, the uncompressed
image would occupy 36,000,000 bytes of memory, a great amount of digital storage
for one image, given that cameras must record and store many images to be practical.
Faced with large file sizes, both within the camera and a storage disc, image file
formats were developed to store such large images.

IMAGE FILE FORMATS:

Image file formats are standardized means of organizing and storing images. This
entry is about digital image formats used to store photographic and other images.
Image files are composed of either pixel or vector (geometric) data that are rasterized
to pixels when displayed (with few exceptions) in a vector graphic display. Including
proprietary types, there are hundreds of image file types. The PNG, JPEG, and GIF
formats are most often used to display images on the Internet.

Fig: Horizontal and Vertical Process


In addition to straight image formats, Metafile formats are portable formats which can
include both raster and vector information. The metafile format is an intermediate
format. Most Windows applications open metafiles and then save them in their own
native format.

IMAGE PROCESSING:

Digital image processing, the manipulation of images by computer, is relatively


recent development in terms of man’s ancient fascination with visual stimuli. In its
short history, it has been applied to practically every type of images with varying
degree of success. The inherent subjective appeal of pictorial displays attracts perhaps
a disproportionate amount of attention from the scientists and also from the layman.
Digital image processing like other glamour fields, suffers from myths, mis-connect
ions, mis-understandings and mis-information. It is vast umbrella under which fall
diverse aspect of optics, electronics, mathematics, photography graphics and
computer technology. It is truly multidisciplinary endeavor ploughed with imprecise
jargon.
Several factor combine to indicate a lively future for digital image processing.
A major factor is the declining cost of computer equipment. Several new
technological trends promise to further promote digital image processing. These
include parallel processing mode practical by low cost microprocessors, and the use
of charge coupled devices (CCDs) for digitizing, storage during processing and
display and large low cost of image storage arrays.

FUNDAMENTAL STEPS IN DIGITAL IMAGE PROCESSING:


Fig:
Basics steps of image Processing

Image Acquisition:
Image Acquisition is to acquire a digital image. To do so requires an image
sensor and the capability to digitize the signal produced by the sensor. The sensor
could be monochrome or color TV camera that produces an entire image of the
problem domain every 1/30 sec. the image sensor could also be line scan camera that
produces a single image line at a time. In this case, the objects motion past the line.
Fig: Digital camera

Scanner produces a two-dimensional image. If the output of the camera or other


imaging sensor is not in digital form, an analog to digital converter digitizes it. The
nature of the sensor and the image it produces are determined by the application.

Fig: Mobile based Camera


Image Enhancement:

Image enhancement is among the simplest and most appealing areas of digital
image processing. Basically, the idea behind enhancement techniques is to bring out
detail that is obscured, or simply to highlight certain features of interesting an image.
A familiar example of enhancement is when we increase the contrast of an image
because “it looks better.” It is important to keep in mind that enhancement is a very
subjective area of image processing.

Fig: Image enhancement process for Gray Scale Image and Colour Image using
Histogram Bits

1.5.3 Image restoration:


Image restoration is an area that also deals with improving the appearance of
an image. However, unlike enhancement, which is subjective, image restoration is
objective, in the sense that restoration techniques tend to be based on mathematical or
probabilistic models of image degradation.

Fig: Noise image Image Enhancement

Enhancement, on the other hand, is based on human subjective preferences


regarding what constitutes a “good” enhancement result. For example, contrast
stretching is considered an enhancement technique because it is based primarily on
the pleasing aspects it might present to the viewer, where as removal of image blur by
applying a deblurring function is considered a restoration technique.

Color image processing:

The use of color in image processing is motivated by two principal factors.


First, color is a powerful descriptor that often simplifies object identification and
extraction from a scene. Second, humans can discern thousands of color shades and
intensities, compared to about only two dozen shades of gray. This second factor is
particularly important in manual image analysis.

Fig: gray Scale image  Colour Image

Segmentation:

Segmentation procedures partition an image into its constituent parts or


objects. In general, autonomous segmentation is one of the most difficult tasks in
digital image processing. A rugged segmentation procedure brings the process a long
way toward successful solution of imaging problems that require objects to be
identified individually.
Fig: Image Segment Process

On the other hand, weak or erratic segmentation algorithms almost always


guarantee eventual failure. In general, the more accurate the segmentation, the more
likely recognition is to succeed.
Digital image is defined as a two dimensional function f(x, y), where x and y
are spatial (plane) coordinates, and the amplitude of f at any pair of coordinates (x,
y) is called intensity or grey level of the image at that point. The field of digital image
processing refers to processing digital images by means of a digital computer. The
digital image is composed of a finite number of elements, each of which has a
particular location and value. The elements are referred to as picture elements, image
elements, pels, and pixels. Pixel is the term most widely used.

Image Compression

Digital Image compression addresses the problem of reducing the amount of


data required to represent a digital image. The underlying basis of the reduction
process is removal of redundant data. From the mathematical viewpoint, this amounts
to transforming a 2D pixel array into a statically uncorrelated data set. The data
redundancy is not an abstract concept but a mathematically quantifiable entity. If n1
and n2 denote the number of information-carrying units in two data sets that represent

the same information, the relative data redundancy R D [2] of the first data set (the one
characterized by n1) can be defined as,

1
R D=1−
CR

Where C R called as compression ratio [2]. It is defined as

n1
CR = n 2
In image compression, three basic data redundancies can be identified and
exploited: Coding redundancy, interpixel redundancy, and phychovisal redundancy.
Image compression is achieved when one or more of these redundancies are reduced
or eliminated. The image compression is mainly used for image transmission and
storage. Image transmission applications are in broadcast television; remote sensing
via satellite, air-craft, radar, or sonar; teleconferencing; computer communications;
and facsimile transmission. Image storage is required most commonly for educational
and business documents, medical images that arise in computer tomography (CT),
magnetic resonance imaging (MRI) and digital radiology, motion pictures, satellite
images, weather maps, geological surveys, and so on.

Image Compression Model

Fig:1.1b) Decompression Process for Image

Image Compression Types


There are two types’ image compression techniques.

1. Lossy Image compression

2. Lossless Image compression


Compression ratio:

1. Lossy Image compression :

Lossy compression provides higher levels of data reduction but result in a less than
perfect reproduction of the original image. It provides high compression ratio. lossy
image compression is useful in applications such as broadcast television,
videoconferencing, and facsimile transmission, in which a certain amount of error is
an acceptable trade-off for increased compression performance. Originally, PGF has
been designed to quickly and progressively decode lossy compressed aerial images. A
lossy compression mode has been preferred, because in an application like a terrain
explorer texture data (e.g., aerial orthophotos) is usually mid-mapped filtered and
therefore lossy mapped onto the terrain surface. In addition, decoding lossy
compressed images is usually faster than decoding lossless compressed images.

In the next test series we evaluate the lossy compression efficiency of PGF. One of
the best competitors in this area is for sure JPEG 2000. Since JPEG 2000 has two
different filters, we used the one with the better trade-off between compression
efficiency and runtime. On our machine the 5/3 filter set has a better trade-off than the
other. However, JPEG 2000 has in both cases a remarkable good compression
efficiency for very high compression ratios but also a very poor encoding and
decoding speed. The other competitor is JPEG. JPEG is one of the most popular
image file formats.
It is very fast and has a reasonably good compression efficiency for a wide range of
compression ratios. The drawbacks of JPEG are the missing lossless compression and
the often missing progressive decoding. Fig. 4 depicts the average rate-distortion
behavior for the images in the Kodak test set when fixed (i.e., nonprogressive) lossy
compression is used. The PSNR of PGF is on average 3% smaller than the PSNR of
JPEG 2000, but 3% better than JPEG.

These results are also qualitative valid for our PGF test set and they are
characteristic for aerial ortho-photos and natural images. Because of the design of
PGF we already know that PGF does not reach the compression efficiency of JPEG
2000. However, we are interested in the trade-off between compression efficiency and
runtime. To report this trade-off we show in Table 4 a comparison between JPEG
2000 and PGF and in Fig. 5 (on page 8) we show for the same test series as in Fig. 4
the corresponding average decoding times in relation to compression ratios.Table 4
contains for seven different compression ratios (mean values over the compression
ratios of the eight images of the Kodak test set) the corresponding average encoding
and decoding times in relation to the average PSNR values. In case of PGF the
encoding time is always slightly longer than the corresponding decoding time. The
reason for that is that the actual encoding phase (cf. Subsection 2.4.2) takes slightly
longer than the corresponding decoding phase. For six of seven ratios the PSNR
difference between JPEG 2000 and PGF is within 3% of the PSNR of JPEG 2000.
Only in the first row is the difference larger (21%), but because a PSNR of 50
corresponds to an almost perfect image quality the large PSNR difference corresponds
with an almost undiscoverable visual difference. The price they pay in JPEG 2000 for
the 3% more PSNR is very high. The creation of a PGF is five to twenty times faster
than the creation of a corresponding JPEG 2000 file, and the decoding of the created
PGF is still five to ten times faster than the decoding of the JPEG 2000 file. This gain
in speed is remarkable, especially in areas where time is more important than quality,
maybe for instance in real-time computation.

In Fig. 5 we see that the price we pay in PGF for the 3% more PSNR than JPEG is
low: for small compression ratios (< 9) decoding in PGF takes two times longer than
JPEG and for higher compression ratios (> 30) it takes only ten percent longer than
JPEG. These test results are characteristic for both natural images and aerial ortho-
photos. Again, in the third test series we only use the ‘Lena’ image. We run our lossy
coder with six different quantization parameters and measure the PSNR in relation to
the resulting compression ratios. The results (ratio: PSNR) are:
2.Lossless Image compression :
Lossless Image compression is the only acceptable amount of data reduction. It
provides low compression ratio while compared to lossy. In Lossless Image
compression techniques are composed of two relatively independent operations: (1)
devising an alternative representation of the image in which its interpixel
redundancies are reduced and (2) coding the representation to eliminate coding
redundancies.

Lossless Image compression is useful in applications such as medical


imaginary, business documents and satellite images.Table 2 summarizes the lossless
compression efficiency and Table 3 the coding times of the PGF test set. For WinZip
we only provide average runtime values, because of missing source code we have to
use an interactive testing procedure with runtimes measured by hand. All other values
are measured in batch mode.
In Table 2 it can be seen that in almost all cases the best compression ratio is obtained
by JPEG 2000, followed by PGF, JPEG-LS, and PNG. This result is different to the
result in [SEA+00], where the best performance for a similar test set has been
reported for JPEG-LS. PGF performs between 0.5% (woman) and 21.3% (logo)
worse than JPEG 2000. On average it is almost 15% worse. The two exceptions to the
general trend are the ‘compound’ and the ‘logo’ images. Both images contain for the
most part black text on a white background. For this type of images, JPEG-LS and in
particular WinZip and PNG provide much larger compression ratios. However, in
average PNG performs the best, which is also reported in [SEA+00].

These results show, that as far as lossless compression is concerned, PGF performs
reasonably well on natural and aerial images. In specific types of images such as
‘compound’ and ‘logo’ PGF is outperformed by far in PNG.
Table 3 shows the encoding (enc) and decoding (dec) times (measured in
seconds) for the same algorithms and images as in Table 2. JPEG 2000 and PGF are
both symmetric algorithms, while WinZip, JPEG-LS and in particular PNG are
asymmetric with a clearly shorter decoding than encoding time. JPEG 2000, the
slowest in encoding and decoding, takes more than four times longer than PGF. This
speed gain is due to the simpler coding phase of PGF. JPEG-LS is slightly slower
than PGF during encoding, but slightly faster in decoding images.

WinZip and PNG decode even more faster than JPEG-LS, but their encoding times
are also worse. PGF seems to be the best compromise between encoding and
decoding times.

Our PGF test set clearly shows that PGF in lossless mode is best suited for natural
images and aerial ortho photos. PGF is the only algorithm that encodes the three
Mega Byte large aerial ortho photo in less than second without a real loss of
compression efficiency. For this particular image the efficiency loss is less than three
percent compared to the best. These results should be underlined with our second test
set, the Kodak test set.

Fig. 3 shows the averages of the compression ratios (ratio), encoding (enc), and
decoding (dec) times over all eight images. JPEG 2000 shows in this test set the best
compression efficiency followed by PGF, JPEG-LS, PNG, and WinZip. In average
PGF is eight percent worse than JPEG 2000. The fact that JPEG 2000 has a better
lossless compression ratio than PGF does not surprise,

because JPEG 2000 is more quality driven than PGF.

However, it is remarkable that PGF is clearly better than JPEG-LS (+21%) and
PNG (+23%) for natural images. JPEG-LS shows in the Kodak test set also a
symmetric encoding and decoding time behaviour. It is encoding and decoding times
are almost equal to PGF. Only PNG and WinZip can faster decode than PGF, but they
also take longer than PGF to encode.
If both compression efficiency and runtime is important, then PGF is clearly the best
of the tested algorithms for lossless compression of natural images and aerial ortho
photos. In the third test we perform our lossless coder on the ‘Lena’ image.

To digitally process an image, it is first necessary to reduce the image to a


series of numbers that can be manipulated by the computer. Each number representing
the brightness value of the image at a particular location is called a picture element, or
pixel. A typical digitized image may have 512 × 512 or roughly 250,000 pixels,
although much larger images are becoming common. Once the image has been
digitized, there are three basic operations that can be performed on it in the computer.
For a point operation, a pixel value in the output image depends on a single pixel
value in the input image. For local operations, several neighbouring pixels in the input
image determine the value of an output image pixel. In a global operation, all of the
input image pixels contribute to an output image pixel value.

Correspondingly, these combinations attempt to strike a winning tradeoff: be


flexible and hence bring tolerance toward intraclass variation, while also being
discriminative enough to be robust to background clutter and interclass similarity. An
important feature of our contour-based recognition approach is that it affords us
substantial flexibility to incorporate additional image information. Specifically, we
extend the contour-based recognition method and propose a new hybrid recognition
method which exploits shape tokens and SIFT features as recognition cues. Shape-
tokens and SIFT features are largely orthogonal, where the former corresponds to
shape boundaries and the latter to sparse salient image patches. Here, each learned
combination can comprise features that are either 1) purely shape-tokens, 2) purely
SIFT features, or 3) a mixture of shape-tokens and SIFT features. The number and
types of features to be combined together are learned automatically from training
images, and represent the more discriminative ones based on the training set.
Consequently, by imparting these two degrees of variability (in both the number and
the types of features) to a combination, we empower it with even greater flexibility
and discriminative potential. A shorter version of this paper appeared in [9].

CLASSIFICATION OF IMAGES:

There are 3 types of images used in Digital Image Processing. They are

1. Binary Image
2. Gray Scale Image
3. Colour Image

BINARY IMAGE:

A binary image is a digital image that has only two possible v values for
each pixel. Typically the two colors used for a binary image are black and white
though any two colors can be used. The color used for the object(s) in the image is
the foreground color while the rest of the image is the background color.

Binary images are also called bi-level or two-level. This means that each pixel
is stored as a single bit (0 or 1).This name black and white, monochrome or
monochromatic are often used for this concept, but may also designate any images
that have only one sample per pixel, such as grayscale images

Binary images often arise in digital image processing as masks or as the result
of certain operations such as segmentation, thresholding, and dithering. Some
input/output devices, such as laser printers, fax machines, and bi-level computer
displays, can only handle bi-level images

GRAY SCALE IMAGE


A grayscale Image is digital image is an image in which the value of
each pixel is a single sample, that is, it carries only intensity information. Images of
this sort, also known as black-and-white, are composed exclusively of shades
of gray(0-255), varying from black(0) at the weakest intensity to white(255) at the
strongest.

Grayscale images are distinct from one-bit black-and-white images, which in


the context of computer imaging are images with only the two colors, black,
and white (also called bi-level or binary images). Grayscale images have many shades
of gray in between. Grayscale images are also called monochromatic, denoting the
absence of any chromatic variation.

Grayscale images are often the result of measuring the intensity of light at each
pixel in a single band of the electromagnetic spectrum (e.g. infrared, visible
light, ultraviolet, etc.), and in such cases they are monochromatic proper when only a
given frequency is captured. But also they can be synthesized from a full color image;
see the section about converting to grayscale.

COLOUR IMAGE:

A (digital) color image is a digital image that includes color information for
each pixel. Each pixel has a particular value which determines its appearing color.
This value is qualified by three numbers giving the decomposition of the color in the
three primary colors Red, Green and Blue. Any color visible to human eye can be
represented this way. The decomposition of a color in the three primary colors is
quantified by a number between 0 and 255. For example, white will be coded as R =
255, G = 255, B = 255; black will be known as (R,G,B) = (0,0,0); and say, bright pink
will be : (255,0,255).

In other words, an image is an enormous two-dimensional array of color values,


pixels, each of them coded on 3 bytes, representing the three primary colors. This
allows the image to contain a total of 256x256x256 = 16.8 million different colors.
This technique is also known as RGB encoding, and is specifically adapted to human
vision

Fig.1 Hue Saturation Process of RGB SCALE Image

From the above figure, colors are coded on three bytes representing their
decomposition on the three primary colors. It sounds obvious to a mathematician to
immediately interpret colors as vectors in a three dimension space where each axis
stands for one of the primary colors. Therefore we will benefit of most of the
geometric mathematical concepts to deal with our colors, such as norms, scalar
product, projection, rotation or distance.

HARDWARE MODULES:
RASPBERRY PI:

Features

• Quad core 64-bit ARM-Cortex A72 running at 1.5GHz

• 1, 2 and 4 Gigabyte LPDDR4 RAM options

• H.265 (HEVC) hardware decode (up to 4Kp60)

• H.264 hardware decode (up to 1080p60)

• VideoCore VI 3D Graphics

• Supports dual HDMI display output up to 4Kp60

Interfaces

• 802.11 b/g/n/ac Wireless LAN

• Bluetooth 5.0 with BLE

• 1x SD Card

• 2x micro-HDMI ports supporting dual displays up to 4Kp60 resolution

• 2x USB2 ports

• 2x USB3 ports

• 1x Gigabit Ethernet port (supports PoE with add-on PoE HAT)

• 1x Raspberry Pi camera port (2-lane MIPI CSI)

• 1x Raspberry Pi display port (2-lane MIPI DSI)

• 28x user GPIO supporting various interface options:

– Up to 6x UART

– Up to 6x I2C

– Up to 5x SPI
– 1x SDIO interface

– 1x DPI (Parallel RGB Display)

– 1x PCM

– Up to 2x PWM channels

– Up to 3x GPCLK outputs

Software

• ARMv8 Instruction Set

• Mature Linux software stack

• Actively developed and maintained

Recent Linux kernel support – Many drivers upstreamed – Stable and well supported
userland – Availability of GPU functions using standard APIs
Mechanical Specification

Electrical Specification

Caution! Stresses above those listed in Table 2 may cause permanent damage to the
device. This is a stress rating only; functional operation of the device under these or any
other conditions above those listed in the operational sections of this specification is not
implied. Exposure to absolute maximum rating conditions for extended periods may affect
device reliability.

Symbol Parameter Minimum Maximum Unit

VIN 5V Input Voltage -0.5 6.0


V Table 2: Absolute
Maximum Ratings

Please note that VDD IO is the GPIO bank voltage which is tied to the on-board 3.3V supply rail.
Symbol Parameter Conditions Minimum Typical Maximum Unit
VI L Input low voltagea VDD IO = 3.3V 0 - 0.8 V
a
VI H Input high voltage VDD IO = 3.3V 2.0 - VDD IO V
IIL Input leakage current ◦
TA = +85 C - - 10 µA
CIN Input capacitanc

e - - 5 - pF VOL
Output low voltageb VDD IO = 3.3V, IOL = -2mA - - 0.4 V
b
VOH Output high voltage VDD IO = 3.3V, IOH = 2mA VDD IO - 0.4 - - V
c
IOL Output low current VDD IO = 3.3V, VO = 0.4V 7 - - mA
c
IOH Output high current VDD IO = 3.3V, VO = 2.3V 7 - - mA
RP U Pullup resistor - 18 47 73 kΩ
RP D Pulldown resistor - 18 47 73 kΩ
a
Hysteresis enabled

b
Default drive strength (8mA)
c
Maximum drive strength (16mA)

Table 3: DC Characteristics

Pin Name Symbol Parameter Minimum Typical Maximum Unit


Digital outputs trise 10-90% rise timea - TBD - ns

Digital outputs tfall 90-10% fall timea - TBD - ns


a
Default drive strength, CL = 5pF, VDD IO = 3.3V

Table 4: Digital I/O Pin AC Characteristics


tfall trise
DIGITAL
OUTPUT

Figure 2: Digital IO Characteristics

1.1 Power Requirements

The Pi4B requires a good quality USB-C power supply capable of delivering 5V at 3A. If
attached downstream USB devices consume less than 500mA, a 5V, 2.5A supply may be used.
2 Peripherals

2.1 GPIO Interface

The Pi4B makes 28 BCM2711 GPIOs available via a standard Raspberry Pi 40-pin header.
This header is backwards compatible with all previous Raspberry Pi boards with a 40-way
header.

5.1.1 GPIO Pin Assignments

Figure 3: GPIO Connector Pinout

As well as being able to be used as straightforward software controlled input and output (with
pro- grammable pulls), GPIO pins can be switched (multiplexed) into various other modes
backed by dedi- cated peripheral blocks such as I2C, UART and SPI.

In addition to the standard peripheral options found on legacy Pis, extra I2C, UART and SPI
peripherals have been added to the BCM2711 chip and are available as further mux options on
the Pi 4. This gives users much more flexibility when attaching add-on hardware as compared
to older models.
5.1.2 GPIO Alternate Functions

Default
GPIO Pull ALT0 ALT1 ALT2 ALT3 ALT4 ALT5
0 High SDA0 SA5 PCLK SPI3 CE0 N TXD2 SDA6

1 High SCL0 SA4 DE SPI3 MISO RXD2 SCL6


2 High SDA1 SA3 LCD VSYNCSPI3 MOSI CTS2 SDA3

3 High SCL1 SA2 LCD HSYNCSPI3 SCLK RTS2 SCL3


4 High GPCLK0 SA1 DPI D0 SPI4 CE0 N TXD3 SDA3

5 High GPCLK1 SA0 DPI D1 SPI4 MISO RXD3 SCL3


6 High GPCLK2 SOE N DPI D2 SPI4 MOSI CTS3 SDA4

7 High SPI0 CE1 N SWE N DPI D3 SPI4 SCLK RTS3 SCL4


8 High SPI0 CE0 N SD0 DPI D4 - TXD4 SDA4

9 Low SPI0 MISO SD1 DPI D5 - RXD4 SCL4


10 Low SPI0 MOSI SD2 DPI D6 - CTS4 SDA5

11 Low SPI0 SCLK SD3 DPI D7 - RTS4 SCL5


12 Low PWM0 SD4 DPI D8 SPI5 CE0 N TXD5 SDA5

13 Low PWM1 SD5 DPI D9 SPI5 MISO RXD5 SCL5


14 Low TXD0 SD6 DPI D10 SPI5 MOSI CTS5 TXD1

15 Low RXD0 SD7 DPI D11 SPI5 SCLK RTS5 RXD1


16 Low FL0 SD8 DPI D12 CTS0 SPI1 CE2 N CTS1

17 Low FL1 SD9 DPI D13 RTS0 SPI1 CE1 N RTS1


18 Low PCM CLK SD10 DPI D14 SPI6 CE0 N SPI1 CE0 N PWM0

19 Low PCM FS SD11 DPI D15 SPI6 MISO SPI1 MISO PWM1
20 Low PCM DIN SD12 DPI D16 SPI6 MOSI SPI1 MOSI GPCLK0

21 Low PCM DOUT SD13 DPI D17 SPI6 SCLK SPI1 SCLK GPCLK1
22 Low SD0 CLK SD14 DPI D18 SD1 CLK ARM TRST SDA6

23 Low SD0 CMD SD15 DPI D19 SD1 CMD ARM RTCKSCL6
24 Low SD0 DAT0 SD16 DPI D20 SD1 DAT0 ARM TDO SPI3 CE1 N

25 Low SD0 DAT1 SD17 DPI D21 SD1 DAT1 ARM TCK SPI4 CE1 N
26 Low SD0 DAT2 TE0 DPI D22 SD1 DAT2 ARM TDI SPI5 CE1 N

27 Low SD0 DAT3 TE1 DPI D23 SD1 DAT3 ARM TMS SPI6 CE1 N

Table 5: Raspberry Pi 4 GPIO Alternate Functions

Table 5 details the default pin pull state and available alternate GPIO functions. Most of these
alternate peripheral functions are described in detail in the BCM2711 Peripherals Specification
document which can be downloaded from the hardware documentation section of the website.
5.1.3 Display Parallel Interface (DPI)

A standard parallel RGB (DPI) interface is available the GPIOs. This up-to-24-bit
parallel interface can support a secondary display.

5.1.4 SD/SDIO Interface

The Pi4B has a dedicated SD card socket which supports 1.8V, DDR50 mode (at a peak
bandwidth of 50 Megabytes / sec). In addition, a legacy SDIO interface is available on
the GPIO pins.

2.2 Camera and Display Interfaces

The Pi4B has 1x Raspberry Pi 2-lane MIPI CSI Camera and 1x Raspberry Pi 2-lane
MIPI DSI Display connector. These connectors are backwards compatible with legacy
Raspberry Pi boards, and support all of the available Raspberry Pi camera and display
peripherals.

2.3 USB

The Pi4B has 2x USB2 and 2x USB3 type-A sockets. Downstream USB current is
limited to approxi- mately 1.1A in aggregate over the four sockets.

2.4 HDMI

The Pi4B has 2x micro-HDMI ports, both of which support CEC and HDMI 2.0 with
resolutions up to 4Kp60.

2.5 Audio and Composite (TV Out)

The Pi4B supports near-CD-quality analogue audio output and composite TV-output
via a 4-ring TRS ’A/V’ jack.

The analog audio output can drive 32 Ohm headphones directly.

2.6 Temperature Range and Thermals


The recommended ambient operating temperature range is 0 to 50 degrees Celsius.

To reduce thermal output when idling or under light load, the Pi4B reduces the CPU
clock speed and voltage. During heavier load the speed and voltage (and hence thermal
output) are increased. The internal governor will throttle back both the CPU speed and
voltage to make sure the CPU temperature never exceeds 85 degrees C.

The Pi4B will operate perfectly well without any extra cooling and is designed for
sprint performance - expecting a light use case on average and ramping up the CPU
speed when needed (e.g. when loading a webpage). If a user wishes to load the system
continually or operate it at a high temperature at full performance, further cooling may
be needed.

6 Availability

Raspberry Pi guarantees availability of the Pi4B until at least January 2031.

Support

For support please see the hardware documentation section of the Raspberry Pi website
and post ques- tions to the Raspberry Pi forum.

RASPBERRY PI OS PROCEDURE:

 With the target SD Card inserted into your computer or


external card reader, open Raspberry Pi Imager.

 When you run Raspberry Pi Imager you are presented


with two options: Choose OS and Choose SD Card.

 Scroll down to the bottom of the list and click on the


Erase option.
 Now click the "Choose SD Card" Option and select the
target SD Card. Note that any data still on this SD card
will be erased forever, and you should ensure that you
have a backup of any files you would like to keep.

 With the SD Card Selected the "Write" option becomes


available. Click Write and wait for the process to
complete. Once the process is complete, a notification
window will open letting you know that it's now ok to
remove the SD card from the reader. Remove the SD
Card and reinsert it into the reader to make it
available again.

 With a freshly formatted SD card, we can now move on


to installing the operating system.
 Click the "Choose OS" button, and select one of the
available operating systems. For the purpose of this
tutorial we will be using the top option, Raspberry Pi
OS (32-Bit)

 Now select the SD card we just formatted in the


previous step.

 The "Write" option will become available. Click "Write"


to begin burning the image to the SD card.

 It can take anywhere from a few minutes to upwards


of half an hour for the process to complete depending
on the quality and speed of the SD card, card reader,
and computer.

If we remove the SD card, unplug the card reader, or


shut down the computer at any point during this
process, the card will become bricked and unusable.

 Once Raspberry Pi Imager has finished writing the


files to the SD card, it will verify that the image on the
SD card is identical to the image file used to burn the
image. This usually takes less than a minute but could
take longer.

 When the verification process is complete, a


notification window will open letting you know that
the write was successful and that it's now safe to
remove the SD card.

 If you're going to run this install with a monitor, you


are good to go.

 If you plan on running headless, there are a few more


steps that you need to take. I cover them in another
instructable that can be found here.
SD CARD:

 You can connect the SD card to a computer using a card reader to access
all the files.

 They come in different capacities, ranging from a few megabytes to


several terabytes.

 There are three main types of SD cards: SD (Standard Capacity), SDHC


(High Capacity), and SDXC (Extended Capacity). They differ in storage
capacity and compatibility.

 SD cards are generally pretty durable, but it's always a good idea to back
up the important data stored on them.

 Photos and videos: This is a typical use for SD cards in cameras and
smartphones.

 Music and documents: You can also store music files, documents, and
other data on an SD card.

 App data: Some devices, like Android phones, allow you to install apps
on the SD card.

 System files: An SD card used with a specific device might have system
files needed for that device to function.

PROCEDURE:

Preparation :
1. Hardware: Get a Raspberry Pi (preferably 4 or higher for better
performance), a USB camera, an SD card, a power supply, and a
monitor/keyboard.

2. Software: Download Raspberry Pi OS (Lite version recommended) and


flash it onto the SD card using an etching tool.

3. Setup: Boot up your Raspberry Pi, connect to Wi-Fi, and update the
system using terminal commands.

Deep Learning Environment :

1. Install Libraries: Use the terminal to install Python, OpenCV (computer


vision library), and TensorFlow/PyTorch (deep learning frameworks).

2. Pre-trained Model: Download a pre-trained license plate detection


model (e.g., EasyOCR, LPRNet) optimized for real-time use.

3. Model Loading: Write a Python script to load the downloaded model


weights and configurations.

Camera and Video Processing:

1. Camera Access: Use OpenCV to access the USB camera and capture
video frames continuously.

2. Pre-processing: Convert frames to grayscale, apply noise reduction, and


resize for efficient processing.

3. Detection: Pass the pre-processed frames through the loaded deep


learning model for license plate detection.
Fake Plate Analysis :

1. Bounding Boxes: The model will generate bounding boxes around


detected license plates.

2. Character Segmentation: Use character segmentation techniques (e.g.,


connected component analysis) to isolate individual characters within the
plate region.

3. Template Matching/OCR: Implement a rule-based system or Optical


Character Recognition (OCR) to analyze characters and identify potential
inconsistencies that might indicate a fake plate (e.g., unusual fonts,
patterns).

Output and Alerts:

1. Display: Draw bounding boxes and analysis results (real/fake) on the


video stream displayed on the Raspberry Pi.

2. Alerts (Optional): For real-time actions, consider sending alerts (email,


SMS) upon fake plate detection.

Conclusion:

In conclusion, the real-time fake number plate detection and analysis system presented in this
project, powered by Raspberry Pi and deep learning technology, represents a pivotal
advancement in enhancing security and law enforcement measures. By leveraging cutting-
edge deep learning algorithms, the system successfully identifies and flags counterfeit
number plates in real-time, offering an efficient and automated solution. The integration with
Raspberry Pi ensures on-board processing capabilities, making the system versatile and
adaptable for deployment in diverse environments. This innovative approach not only
contributes to improved traffic monitoring but also strengthens the integrity of license plate
recognition systems. In the pursuit of heightened security measures, the synergistic
collaboration between Raspberry Pi and deep learning emerges as a powerful tool, paving the
way for more sophisticated and reliable counterfeit detection systems in the realm of
transportation and law enforcement.

FUTURE SCOPE:

1. Integration of additional deep learning techniques such as convolutional neural


networks (CNNs) for improved feature extraction and classification, thereby
enhancing the accuracy and robustness of the detection system.

2. Expansion of the system to support identification and analysis of four-wheeler license


plates, catering to a broader range of vehicles and applications in traffic management
and law enforcement.

3. Incorporation of advanced image processing algorithms to mitigate challenges posed


by varying lighting conditions, occlusions, and perspective distortions, ensuring
reliable performance in real-world scenarios.

4. Development of a user-friendly interface for system configuration, monitoring, and


reporting, enabling seamless integration into existing traffic surveillance and
management infrastructure.

5. Exploration of cloud-based solutions for centralized data storage, analysis, and


collaboration, facilitating scalability and accessibility for stakeholders involved in law
enforcement and traffic regulation.

References:

[1] A. Arshaghi, M. Ashourin and L. Ghabeli, "Detection and classification of potato diseases
potato using a new convolution neural network architecture", Traitement Signal, vol. 38, no.
6, pp. 1783-1791, Dec. 2021.

[2] O. Bezsonov, O. Lebediev, V. Lebediev, Y. Megel, D. Prochukhan and O. Rudenko,


"Breed recognition and estimation of live weight of cattle based on methods of machine
learning and computer vision", Eastern-Eur. J. Enterprise Technol., vol. 6, no. 9, pp. 64-74,
Dec. 2021.

[3] K. Mohi-Alden, M. Omid, M. S. Firouz and A. Nasiri, "Design and evaluation of an


intelligent sorting system for bell pepper using deep convolutional neural networks", J. Food
Sci., vol. 87, no. 1, pp. 289-301, Jan. 2022.

[4] M. Kim, J. Jeong and S. Kim, "ECAP-YOLO: Efficient channel attention pyramid YOLO
for small object detection in aerial image", Remote Sens., vol. 13, no. 23, pp. 4851, Nov.
2021.

[5] P. R. Miranda, D. Pestana, J. D. Lopes, R. P. Duarte, M. P. Véstias, H. C. Neto, et al.,


"Configurable hardware core for IoT object detection", Future Internet, vol. 13, no. 11, pp.
280, 2021.

You might also like