Skip to main content

COMPARATIVE STUDY ON AUTOMATED NUMBER PLATE EXTRACTION USING OPEN CV AND MATLAB

Page 1

International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056

Volume:09Issue:04|Apr2022 www.irjet.net p ISSN: 2395 0072

COMPARATIVE STUDY ON AUTOMATED NUMBER PLATE EXTRACTION USING OPEN CV AND MATLAB

Prof.Christina Josephine Malathi1 , Murali2, Praneeth3, Munwar4 , Sai Srinivas5 , Vineeth6 , Sudheer7

,2,3,4,5,6,7 Student, SENSE, VIT Vellore, Tamil Nadu, India

1 Student, SENSE, VIT Vellore, Tamil Nadu, India

***

Abstract

comparative study on Automatic Number Plate Recognition (ANPR) using open CV python and Matlab is an image processing technology and an important field of research that identifies vehicles based on their licence plates and extracts licence plate information from the vehicle's image or from a sequence of images without direct human intervention. Preprocessing, number plate extraction, character segmentation, and character recognition are the four stages of ANPR. This paper describes an efficient method for extracting number plates from preprocessed vehicle input images by employing morphological operations, thresholding, Sobel vertical edge detection, and connected component analysis, The input image is first converted with an iterative bilateral filter and adaptive data augmentation.

Key Words: Open CV, K NN Algorithm, Gray processing, Image Acquisition, Image Binarization

***

1. Introduction

Theautomaticnumberplaterecognition(ANPR)system is critical in the Intelligent Transportation System (ITS). Vehicles now play an important role in transportation, and their use is increasing as a result of population growth and human needs. These vehicles are effectively controlled using an automatic number plate recognition system. An automatic number plate recognition system (ANPRS) is an image processing technology that identifiesvehiclesbytrackingtheirlicenceplatewithout the need for direct human intervention. There are several other names for ANPR, including automatic licenceplaterecognition,automaticlicenceplatereader, number plate tracking, car plate recognition, vehicle number plate recognition, automatic vehicle identification,andsoon.

InIndia,therearetwotypesofnumberplates: 1) For private vehicles, the number plate has a white backgroundwithblacklettering. 2) For commercial vehicles, the number plate has a yellowbackgroundwithablackborder.

Peoplefromvariouscountriesinteractinamulticultural settingtofindsolutionstomen'snever endingproblems. Python is one of the outstanding contributions to the scientific world in the Open Source section. Computer vision research at Intel has yielded a fruit known as Open Computer Vision (Open CV), which can aid in the developmentofcomputervision.

Vehicle use is increasing across the country at the moment. As their primary identifier, each of these vehicleshasa uniquevehicleidentificationnumber. The ID is actually in the licence number, which refers to a legal permit to participate in public transportation. Every vehicle on the planet must have its own number plate, which must be installed. on its body (at least on the back). They must identify the vehicles, which is increasing in tandem with the number of vehicles. This identificationsystemaidsinsafety,automaticswitching, highway speed detection, light detection, stolen vehicle detection, and human and non human loss collection systems. In the computer system, the auto licence plate recognising system replaces the manual licence plate numberwritingprocess.

1.1 OPEN CV

The Open Source Computer Vision Libraryisa real time application platform and set of programming functions. The open CV library includes algorithms for over 500 optimised algorithms. With forty thousand users, it is mostly used around the world. The first languages used in C C ++ were mostly written in C, making them portable to platforms like the digital signal processor. Python, a recently developed language, has been developed to encourage adoption by a wider audience. These languages' most recent versions include C ++ interfaces. Open CV is a cross platform library with interfaces in C++, Python,and Java.OpenCV isintended to be computationally efficient, with a strong emphasis onreal timeapplications.

© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page3721

International Research Journal of Engineering and Technology (IRJET)

Volume:09Issue:04|Apr2022 www.irjet.net

For the time being, open CV supports many of the improvedalgorithmsforcomputervisionandautomated learningthatarebeingdistributedonadailybasis.Open CV currently supports a wide range of programming languages, including C++, Python, and Java, and is available on a variety of platforms, including Windows, Linux, OS X, Android, and iOS. Python was used as a coding language in this system. It's known as Open CV Python. We chose the snake because it is more effective and easier to understand. The proposal combines the bestfeaturesofOpenCVandPython.

1.2 NUMBER PLATE EXTRACTION USING MATLAB

The proposed Automatic Car Number Plate Recognition System focuses primarily on red light jumping. If a vehicle runs a red light, sensors are installed to detect the presence of the vehicle. As the vehicle approaches the sensor, the camera will capture an image using MATLABimageprocessing.Theimageisthenprocessed, and the number extracted from it. The information will beusedtomatchtheregisteredvehiclenumberwiththe numbers of the predefined record. We will be able to trackdowntheownerwhoviolatedtheredlight.Then,a record of rule brokers will be kept, and the challan will be entered in that record and can be punished. Independent plotting, a graphical user interface, and a MATLAB compiler are all included here for the number plate recognition application, MATLAB is used. The task is to build the algorithm and acknowledges it using MATLAB. MATLAB is extremely efficient because it includes built in tools for neural network and image processing.SomeoftheadvantagesofusingMATLABare as follows, MATLAB's features include platform independence, predefined function and device independent plotting, graphical user interface, and MATLABcompiler.

2.METHODOLOGY

2.1 OPEN CV

To read the image, we can use the OPENCV library, which allows us to read an image and then convert it from BGR to Grayscale. We used the MATPLOTLIB libraryandtheinshowfunctiontodisplaytheimage.

Following that, we performed filtering to remove noise from the image, followed by edge detection to detect edgesin the image,andwe usedtheCannyalgorithmto detectedges. Next, we performed contour detection; we are looking for a contour with four points so that we can see a rectangle; we used the find contours function, which searchesforcontoursinourimage. Followingthat,wewillloopthrougheachofthecontours toseeiftheyrepresentarectangle(NumberPlate).

2022, IRJET

e ISSN: 2395 0056

p ISSN: 2395 0072

We masked the image and displayed the masked image after specifying the contour locations (number plate) Theimage'snumberplatehasbeenisolated. Wehaveto read that text, so we used the easyocr and reader functiontodoso.

Impact Factor value: 7.529

FIG 2.1: ApproachusingopenCV

2.2 MATLAB

This section depicts the proposed method for number plate extraction. This system receives a vehicle image captured with a digital camera as input and outputs the actual number plate portion. Images are captured in a variety of lighting and background conditions. The proposed method's flowchart is shown in Fig, and it consistsofthefollowingmainsteps:

1)ImageCapture.

2)ConversionofRGBtograyscale.

IterativeBilateralFilteringisusedtoremovenoise.

4) Adaptive Histogram Equalization is used to improve contrast.

5)Imagesubtractionandmorphologicalopening

6)Binarizationofimages.

Sobeloperatordetectsedges.

8) Detection of candidate plate areas via morphological openingandclosingoperations.

9)Extractionoftheactualnumberplatearea.

10)Extractedplateregionenhancement.

9001:2008

©
|
| ISO
Certified Journal | Page3722

International Research Journal of Engineering and Technology (IRJET)

Volume:09Issue:04|Apr2022 www.irjet.net

SOFTWARE

3.1 OPEN CV

3.1.1. CAPTUERE THE INPUT IMAGE:

A high resolution camera was used to capture the car's number pad. The resolution of the number plate recognitionsystemisdeterminedbytheimagecaptured. The RGB image captured must be converted to a grayscaleimage.

3.1.2. PRE PROCESSING:

Pre processing is a set of algorithms that are applied to animagetoimproveitsqualitybeforeitisconvertedtoa binary image. The image is smoothed before being converted to a binary image to reduce noise. The threshold algorithm can perform pre processing. There arevarioustypesofthresholds,suchas •Globalthreshold

•Thresholdforadaptivemean

•GaussianadaptivethresholdGlobalcriterion: Thethresholdisanonlinearprocessinwhichtwolevels areassignedtopixelsthataresmallerorlargerthanthe specified threshold value. The threshold value is fixed. According to the formula, the grayscale image is converted to a binary image. Dst (x, y)=max value if src(x,y)>T(x,y) 0 else Where T (x, y) is the threshold calculated for each pixel individually. The average adaptivethresholdis:Thethresholdvalueistheaverage area of the neighbourhood. Threshold Gaussian Adaptive: The sum of the values of the values of the neighbourhood where the weights are a Gaussian window is the threshold value. The adaptive threshold

e ISSN: 2395 0056

p ISSN: 2395 0072

methodis thenusedtoconvert thegrayscaleimage to a binary image. The threshold is the most basic way to separateobjects.

3.1.3. NUMBER PLATE LOCALIZATION :

A shape analysis or a colour analysis method is used to extract the licence plate. The General License Panel is shaped like a rectangle. As a result, algorithms seek geometrical shapes with a rectangular proportion. BecausemostlicenceplatesinIndiaarewhiteoryellow, colouranalysiscanalsobeused.Beforeyoucanfindthe rectangleinanimage,itmustbeinbinaryformatorthe image's edges must be detected. Then you must locate andconnecttherelevantrectangularcorners.Finally,all rectangularareasofinterestareextractedandtheareas connectedtotheboxareconnected.

3.1.4. CONNECT COMPONENT ANALYSIS:

Thealgorithmofthecomponentconnectedtothebinary filter is used first to remove the unwanted image space. Todeterminethecharactersintheimage,theconnected component is parsed. The basic idea is to traverse the image in search of a connected pixel. Each component (dots)isidentifiedandextractedseparately.

3.1.5. SEGMENTATION:

Oncethelicenseplatehasbeenextracted,eachcharacter must be fragmented. For component division, the componentlabel isusedtoseethecomputerinorderto discover the connected areas in binary digital images. Thelabelofconnectedcomponentsworksbyscanninga pixel in pixel image from top to down to find connected pixelsandconnectedpixelcards.

3.1.6.CHARACTER RECOGNITION:

The segmented characters in the licence panel must match the templates that have already been created in ordertobeidentified.Thelicencenumberisreturnedin ASCII format and saved in a text document by the recognition process.Thereisa two track processinthis recognition. The first pass attempted to identify each word individually. Each acceptable word is fed into the adaptive workbook as training data. The adaptive workbookisgiventheopportunitytolearnthetextmore thoroughly.

3.2 MATLAB

3.2.1. Image Acquisition:

The first step is to obtain the vehicle input image. A digitalcamerawasusedtocapturetheimage.Imagesare captured in a variety of lighting conditions and at varying distances from the camera. The image of the inputvehicleisshowninFig.

© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page3723
FIG 2.2: ApproachusingMATLAB
3.
IMPLEMENTATION

International Research Journal of Engineering and Technology (IRJET)

Volume:09Issue:04|Apr2022 www.irjet.net

3.2.2. Pre Processing:

Inbasicaimofpre processingistoimprovethecontrast of the input image, to reduce the noise in the image, hence to enhance the processing speed. In pre processingRGBimageisconvertedintograylevelimage andthenintobinaryimage.Thecontrastenhancementis done by histogram equalization, contrast stretching etc. Various filters are used to remove noise from the input image. In the proposed approach for number plate extraction, the input image is enhanced by applying adaptive histogram equalization technique and noise is removedbyiterativebilateralfiltering.

1) RGB to Gray Scale Conversion:

TheRGBformatofthecapturedinputimageisused.The first step in the preprocessing process is to convert the RGB image to a grayscale image. The primary goal of colour conversion is to reduce the number of colours. The R, G, and B components of each pixel's I j) 24 bit colour value are separated, and an 8 bit grey value is calculated.ThegrayscaleimageisshowninFig.

2) Noise Removal by Iterative Bilateral Filter:

The primary goal of filtering is to remove image noise and distortion. Noise can occur during camera capture andasaresultofweatherconditions.Fornoiseremoval, the proposed method employs an iterative bilateral filter. Non linear filter is iterative bilateral filter. It provides a mechanism for noise reduction while more effectively preserving edges than the median filter. Figure 3 shows the outcome of applying an iterative bilateral filter to a grayscale image. 3) Contrast Enhancement Using Adaptive Histogram Equalization: Contrastisdefinedasthedifferenceinintensitybetween thelowestandhighestlevels.Histogramadaptiveimage. is a technique for more effectively spreading the histogram of pixel level. Adaptive histogram adaptive image. outperforms histogram adaptive image.in terms ofcontrast.Thefiguredepictscontrastenhancementvia adaptivehistogramadaptiveimage.

3.2.3. Morphological

Operations for Image Subtraction and Opening Using a disc shaped structuring element, a morphological opening operation is performed on a contrast enhanced grey scale image. The morphological opened image is subtractedfrom thecontrastenhancedgrey scaleimage in image subtraction. Fig shows the outcome of an opening operation on a contrast enhanced grey scale image using a disk shaped structuring element, and Fig shows the outcome of an image subtraction between a contrast enhanced grey scale image and an opened image.

3.2.4. Image Binarization:

The subtracted grey scale image is converted into a binary image in this operation. To begin, Otsu's method

e ISSN: 2395 0056

p ISSN: 2395 0072

is used to calculate the threshold level. In MATLAB, the graythesh function is used to determine the image's threshold level, and the subtracted grey scale image is converted to black and white using the im2bw function based on the calculated threshold. Figure depicts a binarizedimage.

3.2.5. Edge Detection by Sobel Operator: Sobel operator detects vertical edges, and the result of applying Sobel operator to binarized image is shown in Fig.

3.2.6. Candidate Plate Area detection by Morphological Opening and Closing Operations: Unwanted objects in the image are removed using morphologicaloperations.Inordertodetectacandidate plate area, a dilation operation is first applied to a detected sobel edge image, and then the hole is filled usingtheMATLABimfillfunction.Theresultsofapplying thedilationoperationandfillingholesareshown inFig. Then, for precise detection of candidate plate area, morphologicalopeninganderodeoperationsareused.

4.OUTPUT 4.1 OPEN CV

© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page3724
FIG 4.1.1: GrayscaleImage
International Research Journal of Engineering and Technology (IRJET) e ISSN: 2395 0056 Volume:09Issue:04|Apr2022 www.irjet.net p ISSN: 2395 0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page3725 Fig 4.1.2: EdgeDetection Fig 4.1.3: Contouring Fig 4.1.4: Masking
Fig
4.1.5 RenderResult 4.2 MATLAB
Fig
4.2.1: Gray Scaling
Fig
4.2.2:Noiseremoval

International

Volume:

Fig

4. CONCLUSIONS

At the moment, open CV is a fantastic open source libraryforcomputervision witha largeuser base.Open CV has far more capabilities for viewing the computer than MATLAB [2]. Many of their operations are handled by the GPU. The library is constantly being updated (a newversionisreleasedevery3to4months).Ingeneral, the open CV C ++ programme executes faster than the MATLAB code. Open CV has more computer viewing functions than MATLAB. Many of their operations are handled by the GPU . The C ++ Open CV code is usually faster than the MATLAB code, but when compared to openCVC++,openCVisfarsuperior. Python is better and easier to learn than other programming languages such as C ++ when it comes to computer vision. What a useful tool you should become acquainted with. Computer vision engineer / programmer As of now, we have the option of using

Technology

e ISSN: 2395 0056

p ISSN: 2395 0072

Open CV in C++, Open CV in Python, or Open CV in MATLAB. There were no good libraries to see the computerinthepast.Wediscoveredthesestudiesusing relevant books and began coding the special library of specialalgorithmsforcomputervision.

OpenCV,likeMATLAB,isdesignedforimageprocessing andisusedasanalternativetoolthatismuchfasterthan othersimulations.EachfunctionisdesignedinOpenCV, and the function structure and data are coded using image processing software. On the other hand, we can get almost anything in the world in the form of Matlab toolboxes.MATLABisarelativelysimplelanguage,butin some cases, this high level programming language has become slower. In such cases, open CV performs better and yields more accurate results. Similarly, handling some code to model the idea of processing your images can be very simple. Python is one of the Open Source community's outstanding contributions to the scientific world.

5. REFERENCES:

[1] D.M.TELLAPAVANI,"NumberPlateRecognitionby usingopenCV Python,"IRJET,p.6,2019.

[2] H.S.A.S.N.A.N.G.N.N.Jameson,"MultipleFrames CombinationVersus,"JournalofInformation Assurance&Security,,VOL8;2019.

[3] B Z a 1.Fiusser,""Imageregistrationmethods"," ImageandVisionComputing,vol 21,no.II,pp 977

[4] M.K.P.a.M.G.K.]S.C.Park,"Super resolution imagereconstruction:atechnicaloverview,","IEEE, vol.20,pp.21 36,2013.

[5] M M A A M T.AmrBadr,"AutomaticNumberPlate Recognition,MathematicsandComputer,"CSS,Vol 38(I),2020,62 71.

[6] M.Singh,",ANewandEfficientMethodforVehicle LicensePlateDetection,"InternationalJournalof AdvancedResearchincomputerscienceand softwareengineering,December 2019,pp.1002 1006.

[7] R E W a S.L E RafaelC Gonzalez,"DigitalImage ProcessingusingMATLAB,"IEEE

Research Journal of Engineering and
(IRJET)
09Issue:04|Apr2022 www.irjet.net
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page3726
Fig
4.2.3:Noiseremoval
Fig
4.2.4:Noiseremoval
4.2.5:Noiseremoval

Turn static files into dynamic content formats.

Create a flipbook