Professional Documents
Culture Documents
Pre-processing
Contours
Optical Character Recognition
PRE-PROCESSING
Fig.1 Basic LPR block diagram i)Bilateral filter
ii)Canny edge detection
METHODOLOGY BILATERAL FILTER
Work flow: A type of de-noising technique known as bilateral filtering can
keep sharp edges while removing certain colours from the
edges. This filter is simple to comprehend since it uses the
weighted mean of nearby pixels. Furthermore, there is a space
between pixel values, allowing it to be appropriately adapted.
Not to mention, this filter is non-iterative, which makes it quite
straightforward.
The box, Gaussian, and bilateral filters are some of the most
well-known filters used in image processing. We are aware that
all of these filters are used for deblurring and smoothing.
Furthermore, certain elements that were there in the original
image but were hidden by these filters will enhance the final
image. We will get the conclusion that the bilateral filter is the
best after analysing the four filters and taking the ideal sigma
value into consideration.
G ( x . y )=
1
2 π σ2
exp
2σ (
−x 2+ y 2
)
where y is the vertical axis distance from the origin, x is the
horizontal axis distance from the origin, and is the Gaussian
distribution's standard deviation.
Fig.4 De- noised image
Calculate image gradient : The Canny edge detection operator
is used in the gradient computation stage to calculate the picture
CANNY EDGE DETECTION gradient and identify the edge and direction intensities. The edge
pixels with sharp variations in grey area values are found by
Principle of canny edge detection algorithm computing the picture gradient. The gradient is a unit vector
Based on edge characteristics, this approach is a detection since it is represented by points that point in the general
algorithm. The text processing procedure will continue with the direction of intensity variation. At this point, the gradient's
text attribute value being unchanged, but the text itself won't be vertical and horizontal components are computed first, followed
processed—only the text image's data size will be reduced. by the gradient's magnitude and direction [15].
There are now several edge detection-based techniques in use. The following formulas are used to determine the gradient's
Canny algorithm is employed in this research. Text recognition magnitude G and angle :
benefits from this algorithm's ability to effectively handle the
Gradient Magnitude=G=√G x + GY
edge detection challenge. There are many different edge 2 2
detection techniques, thus a clever algorithm will choose which
edge detection is best for the situation. in the following sense.
(1) Strive for the best detection: Edge detection will attempt to
extract as many text edge properties as it can while also aiming
for the lowest detection miss probability.
Gradient Angle=θ=are tan
( )
Gy
Gx
(2) Edge location rule: According to this rule, there cannot be a The horizontal and vertical gradients are represented by G x and
considerable discrepancy between the edge position of the
search and the edge position of the actual text; rather, the point G y , respectively.
of the edge search must be reasonably close to the edge point of
the real text. Four filters are used in the Canny edge detection technique to
determine the diagonal, vertical, and horizontal edges in the
(3) A comparison between the search location and the edge blurred picture. Additionally, one of the four angles illustrating
location: The algorithm lines up the search point and the text the vertical, horizontal, and the two diagonals is used to
point. represent the edge direction angle (00, 450, 900, 1350 degrees).
In order to improve edge recognition, the Canny edge detection The first derivative is estimated in the horizontal direction Gx
method was created. For this purpose, consideration was given and vertical direction Gy as a consequence [16]. The Canny
to three crucial elements. Identifying all of the principal edges in
the reference image was the first and most crucial requirement. algorithm then finds the edges where the intensity of the grey
Reduced edge error was the main objective. The edge points that level fluctuates the greatest.
were found had to be as close to the correct edge as is physically
possible, which was the second condition. Not having several Non-maxima suppression (NMS) : This approach is based on
reactions to one edge was the last criteria. The third stage was one of the two approaches commonly used to identify edges, the
implemented because the first two circumstances were not first of which is to see edges as zero-crossings of the Laplacian
severe enough to entirely rule out the possibility of more than of picture intensity [17, 18]. The second is to use a technique
one reaction to an edge. known as NMS, which involves suppressing the local non-
maxima of the magnitude of the gradient of image intensity in
The Canny method is one of the most well-known because it can
the gradient's direction. The final image should have sharp
maintain a low error rate, preserve important information by
edges, ideally. So, in order to smooth the edges, we must
removing spam, retain fewer alterations from the primary
complete NMS. NMS can also successfully locate the edge and
picture, and remove multiplex answers to the near edge. The
prevent the occurrence of false edges.[18].
Canny edge detection method functions as follows [13] based on
this criterion. There are five distinct steps in the Canny
algorithm. NMS is also based on the gradient magnitudes that the detector
converts the thick edges of the image, to nearly thin and sharp
edges which can be more utilized for identification purposes. It
Noise detection: Smoothing may be used to reduce noise, but
is mainly performed in NMS for thinning the edge. In this
the results are more susceptible to image noise since the
process, the image is scanned along the edge direction and
mathematics used in edge detection is inherently derivative-
rejects any pixel value that is not considered to be an edge
based. The image may be made noise-free by using a Gaussian
which will result in a thin line in the output image.
blur to smooth it out. To do this, a Gaussian kernel and the
image concentration technique (3x3, 5x5, 7x7, etc.) are used.
What defines the size of the core is the expected blur's trace. The Double thresholding : The threshold value is divided into two
blur is essentially less for the smallest kernel is less noticeable. parts: T1 is a high threshold and T2 is a low threshold. Edge
area is the outcome if the pixels with values of a grayscale level have the same intensity or hue can be blocked out by contours,
greater than T1 are strong edge pixels. If the pixels with values which are simply read as a curve connecting points continually.
of a grayscale level less than T2 are weak edge pixels, the In a line of text, the contour of each word is identified using a
outcome is the non-edge area. The outcome depends on the straightforward procedure that involves tracing the line.[12].
pixels nearby. If the pixels have grayscale values between T1
It is most useful for analysing the form of the supplied image,
and T2 [24]. The stage's objective was to categorise the pixels
determining the size and dimensions of the object that must be
into three groups: strong, weak, and irrelevant. We applied this
found in the provided image, and identifying particular objects.
step as follows in this paper:
This is done in order to classify the forms of objects, segment
photos, crop things from the processed image, and many other
− Small enough to be ignored as irrelevant edge detection are related tasks.
weak pixels, which have an intensity value but not enough to be
taken into account.
DRAW CONTOURS
Providing you have the boundary points for the form, you may
use it to create any shape's contours. Its first parameter is the
source picture, the second argument is the contours, which
should be supplied as a Python list, and the third argument is the
index of contours (helpful for drawing each contour). Pass -1)
and the remaining arguments—color, thickness, etc.—will draw
Fig.5 edge detection using Canny edge detection all contours.
CONTOURS
i) Find Contours
ii) Draw Contours
FIND CONTOURS
In order to recognise when two-dimensional pictures or objects
are being searched for, OpenCV (EmguCv) created the Find
contour algorithm. The OpenCV library, which stands for Open
Computer Vision, was introduced by Intel in 1999. Objects that
o Word and character detection - Establishes a
framework for word and character forms, separating
words as appropriate.
Fig.8 drawing the selected contours o Script recognition – In multilingual documents, the
script may change at the level of the words and
hence, identification of the script is necessary, before
OPTICAL CHARACTER RECOGNITION the right OCR can be invoked to handle the specific
(OCR) script.
o Character isolation or "segmentation" – For per-
character OCR, multiple characters that are
connected due to image artifacts must be separated;
single characters that are broken into multiple pieces
due to artifacts must be connected.
o Normalise aspect ratio and scale.
RESULTS ANALYSIS
Fig.11 and Fig.12 demonstrates the retrieved text. The text was
placed to match the image of the number plate on the licence
plate. A tesseract was used to read the cropped image's output.
We acquired 88 results for precise licence plate numbers after
running our algorithm on more than 100 images. In addition to
these, we tested our algorithm on a wide range of random
datasets and found that it performed well on most of them. A
few errors also happen, which shows that we need to work on
our project more accurately. We need a capable OCR engine
that can read text more accurately and more efficient filters to
reduce background noise in order to do this.
TABLE 1
REFERENCES
This study implements an effective approach for detecting [10]. F. Ali, H. Rathor and W. Akram, "License Plate
automobile licence plates. The input picture was evaluated using Recognition System," 2021 International Conference on
a bilateral filter and prepossessed using several techniques. The Advance Computing and Innovative Technologies in
cropped image of the licence plate for the car is automatically
Engineering (ICACITE), 2021, pp. 1053-1055, doi:
10.1109/ICACITE51222.2021.9404706.