Application of Machine Learning for Automatic Number Plate Recognition Using Optical Character Recognition Engine

DOI : 10.17577/IJERTV13IS050144

Download Full-Text PDF Cite this Publication

Text Only Version

Application of Machine Learning for Automatic Number Plate Recognition Using Optical Character Recognition Engine

Published by :

International Journal of Engineering Research & Technology (IJERT)

ISSN: 2278-0181

Vol. 13 Issue 5, May 2024

Osakwe Anthony Abuchi

Dr. Arul Lenna Rose .P.J

Dr. Aarthi. E

Department of Computer Science


Assistant Professor

Srm Institute of

Srm Institute of

Srm Institute of

Science and

Science and

Science and

Technology, Chennai, India

Technology, Chennai, India

Technology, Chennai, India

Abstract—In Nigeria, traffic control management, vehicle real- time tracking and vehicle identification have become imperative to law enforcement to enable them to digitalize or make use of computer vision to easily carry out tasks like identifying traffic offenders, tracking stolen vehicle plates in real time using traffic cams and ultimately identifying vehicle ownership using plate number in seconds. Hence, there is a need to introduce an innovative system, leveraging machine learning and optical character recognition using OpenCV and TensorFlow to produce an effective automatic number plate recognition (ANPR) software to combat such issues. This research paper seeks to use a novel methodology by using TensorFlow for model training and OpenCV for processing number plate photos to achieve identification. The recognized plate numbers will then be stored in a database.

Keywords—Automatic Number Plate Recognition (ANPR), Optical Character Recognition (OCR), Convolutional Neural Networks (CNNs).


    Smart transportation and effective enforcement of traffic rules on motorists by utilizing traffic cams is based on the Automatic Number plate Recognition System. Recognition and identification of number plates are achieved without direct human involvement in any way by ANPR. Proficiency in this discipline is imperative for efficiently and expeditiously discerning vehicle registration plates. It is used in many scenarios such as managing parking lots, enforcing traffic laws, and collecting road tolls. Researchers have concluded that ANPR algorithms are divided into 4 generic steps:

    (1) Vehicle plate image capture (2) Vehicle plate number detection (3) Segmentation of characters and (4) Recognition of characters.

    The first step vehicle plate image capture particularly refers to the technique of collecting photographs of license plates from vehicles, secondly, vehicle plate number detection, sometimes referred to as license plate recognition (LPR), is the process of mechanically extracting the license plate numbers from collected photographs, thirdly, character segmentation is an essential process in optical character recognition (OCR) systems. Its purpose is to recognize and extract individual characters from the identified Nigerian car plate and lastly, character recognition is the ultimate stage in the process of Automatic Number Plate Recognition (ANPR). During this stage, the system identifies and converts the individual characters on the license plate into text that can be read by a human.

    Based on a dataset of over 1000 vehicles with number plates from Kaggle an open source dataset library from Google and manually obtained vehicle number plates of cars from different states in Nigeria of over 500 in number, this paper aims at using 1,100 as training dataset and 400 as testing data to utilize computer vision technology to automatically identify Nigerian made number plates effectively with high output rate.


    We have thoroughly assessed other research articles on the subject and used the most effective strategies in our study. We have synthesized a concise comprehension derived from several referenced works in this research.

    To locate the license plate position of a Chinese car A method for calculating vertical as well as horizontal disparities to produce an exact rectangle with a vehicle number was proposed by Hui Wu and Bing Li

    [1]. The authors used MATLAB to automate binarization after converting the vehicle image to grayscale. This document makes no mention of any more information on the number plate identification technique. According to the authors, they were able to recognize objects in an average of

    0.8 seconds.

    A clever edge detector operator was used in

    1. to identify the transition points. A driver's license plate contains black characters on a white background, according to H.Erdinc Kocer et al. The noise is removed by the Canny edge detector by applying a filter that is based on the first derivative of Gaussian smoothing. The gradient of the picture is then taken into account when estimating the edge strength in the next phase. To get this assignment, the astute edge detector operator used a 3 X 3 matrix. The zone of transition points is computed using this data. The transition spots between the colours black and white are found using the edge map. The more intricate technical details of this process are not given. A CCD camera was used to take the pictures of the cars.

      Improved segmentation techniques have been presented by Ankush Roy et al.

    2. for the purpose of distinguishing number plates of different countries. To remove noise, binarize the picture, label pixels based on colour values, segment the 15 × 15 plate, and partition the image, four steps are involved: median filtering, adaptive thresholding, component labelling, region growth, and segmentation and normalization. For image binarization in the adaptive thresholding process, the authors used Otsu's method. The system's overall success rate is given; however, this research makes no mention of the number plate detection rate's success rate.

    An alternative SCW-based technique for locating Korean license plates is given in

    [4]. The authors used the HSI colour model to confirm the colour after applying SCW to the vehicle image. To account for incline, they then used least squares fitting with perpendicular offsets (LSFPO). The camera may be placed anywhere from three to seven meters away from the vehicle. A sliding concentric window (SCW) approach is developed in

    1. to facilitate faster recognition of regions of interest (ROIs). The two-step procedure shifts the top left corner of the picture by two concentric windows. The segmentation rule, which specifies that the centre pixel of the frames is judged to be a component of an ROI if the ratio of the mean or median in the two windows over a threshold as set by the, was then used to construct statistical indicators for both windows. The two windows will stop sliding when the whole image has been scanned. The threshold value may be found

      via a combination of trial and error approaches. A connected component assessment is also used in order to get a 96% overall success rate. In this experiment, a Pentium IV operating at 3.0 GHz with 512 MB of RAM completed license plate segmentation in 111m.

      The writers of reference

    2. used a weighted statistics technique. Before doing any analysis, they first turned a 24-bit colour picture into a grayscale form. For processing, the picture was represented as a 2D matrix with N rows and M columns. They carried out a weighting method and improved the picture matrix by adding weights. The standard ratio for license plate dimensions is 3.14:1, according to Zhigang Zhang et al. Nevertheless, the technical details of this approach are not covered in this article. An analogous method is suggested in reference

      [7].An approach based on a probabilistic neural network (PNN) is provided in the article cited in reference

      [8]. Grayscale photos are intended to be used with this strategy. First, Bottom-up filtering is used to identify possible license plate regions. The item of interest is then distinguished from the background by using thresholding to transform the grayscale picture into a binary image. Otsu's Thresholding technique is used for flexibility since brightness levels may be affected by variations in lighting conditions. To help with categorization, each component of the binary picture has a label corresponding to its colour. By locating the Column Sum Vector's (CSV) local minima, license plate extraction is achieved. An Intel® CoreTM2 Duo Processor CPU P8400 (2.26GHz, 2267 MHz) was used to run the algorithm, and it took 0.1 seconds to analyze a license plate.


    recognition of characters and the use of different algorithms for registration plate identification have a favourable impact on the analysis of registration plate images. Thus, they serve as the core component of any ANPR system. The ANPR system consists of a camera, image processing software, a computer system, and a frame grabber for analysis and recognition. The significance of Number Plate Recognition has significantly increased in recent years. Extensive studies have been conducted to identify different types of vehicles, such as cars and trucks. The Support Vector Machine [9] is used for car model identification. They presented the quantitative results using over 50 data set images. There is a sufficient array of programs and software accessible on the market to identify license plates. These systems effectively fulfil their objective with few constraints. Some of these applications need an extensive period of identification and also demand images of excellent quality.

    Certain important drawbacks of the present system are discussed below. These also cause some hinges to our goal and we aim at deleting most of them in our future modifications.

    1. Drawbacks

        • Number plates from two or more states might have the same number pattern but different designs, including those automobiles belonging to dignitaries and government officials with distinct makeup.

        • Automobile lane change at the point of ANPR camera scanning the plates.

        • A piece of dirt or dust particles covering the plate or some part of the plate.

        • Blurry visuals, especially due to the high speed of vehicles.

        • Inadequate lighting and low contrast owing to prolonged exposure and reflection of shadows.

        • Low image resolution, generally because the plate is too distant but occasionally arising from the adoption of black and white quality cameras.


    Nigeria, a nation of approximately 218.5 million people in an area of 923,768 km2 (356,669 sq mi) according to Wikipedia, has unique demands for the ANPR system than other nations. The primary applications of ANPR are in parking control, traffic surveillance, and community law enforcement security. In Nigeria, there is one fatality for every four minutes, most of which are caused by speeding and bad roads. The average speed of the cars can be tracked by ANPR if implemented, which may also be used to detect cars that go above the speed limit stipulated by the law. This contributes to the preservation of law and order, which may reduce the amount of people killed on the roads.

    Fig. ANPR System.

    Both the hardware and the software parameters were taken into consideration when the ANPR System was implemented. Together with several Python libraries, TensorFlow and OpenCV are essential components of a successful Automatic Number Plate Recognition (ANPR) system. Licensing plate pictures for analysis requires image preparation using OpenCV, which includes activities like scaling, boosting contrast, and filtering. Next, by using TensorFlow, one may train a Convolutional Neural Network (CNN) model to precisely identify license plates in pictures.

    Fig. Output Images

    1. Convolutional Neural Networks

      The Convolutional Neural Network (CNN) model is essential in the Automatic Number Plate Recognition (ANPR) system for precise detection and identification of characters on license plates. A Convolutional Neural Network (CNN) is a specialized deep learning model that is particularly effective in handling visual input. It is primarily built for tasks such as object identification and picture recognition. The Convolutional Neural Network (CNN) in the Automatic Number Plate Recognition (ANPR) system is trained using extensive datasets of license plate photos that have been annotated. Through this training, the CNN learns to recognize and differentiate characters from background noise and other components inside the image by identifying certain patterns and characteristics. After being trained, the Convolutional Neural Network (CNN) analyzes incoming license plate photos by using convolutional filters to extract important characteristics.

      but nevertheless maintained an efficacy level of over 80%. The results emphasize the capability of ANPR systems using OpenCV and TensorFlow to successfully detect license plates in various geographical settings. These findings provide useful information for improving and implementing these systems in practical scenarios.

      Fig. Detection Rate of Plate Numbers.

    2. Dataset

      Fig. CNN Architecture.


      To summarize, this research demonstrates that ANPR systems including OpenCV and TensorFlow are very successful in accurately detecting license plates in different Nigerian states. The shown performance, with an average detection rate varying from 80% to 88%, highlights the potential of these technologies in improving vehicle recognition and tracking capabilities. In the future, it is recommended to prioritize enhancing the system's capacity to identify certain types of license plates, such as those used by government, military forces, and diplomatic vehicles. These

      The dataset consists of more than 1000 automobiles with number plates sourced from Kaggle, an open-source dataset library by Google. Additionally, it includes around 500 vehicle number plates from in several states in Nigeria sourced from Google.


Among the several methods considered in this research, Automatic Number Plate Recognition (ANPR) using OpenCV and TensorFlow proved to be the most effective, taking into account the inherent constraints of an ANPR system. By using these technologies, we gathered a complete dataset consisting of photographs from different regions in Nigeria. The dataset contains a total of 400 images, largely obtained from Google. The Automatic Number Plate Recognition (ANPR) system demonstrated a favourable performance, with an average detection rate ranging from 80% to 88% across several states. States like Lagos, Rivers, and Imo had a very high detection rate of 88%, which suggests a strong ability to recognize license plates. In contrast, states like Kogi and Yobe had somewhat lower rates

plates may have distinct characteristics that are not currently well accounted for in the existing study. This may include integrating supplementary image processing methodologies and training the model on a mre varied dataset that encompasses examples of these specific plates. Moreover, investigating sophisticated machine learning methods and adding domain-specific information might further boost the system's accuracy and resilience in detecting specialty license plates, hence broadening its usefulness in real-world settings.


  1. Hui Wu and Bing Li, "License Plate Recognition System," in International Conference on Multimedia Technology (ICMT), 2011,

    pp. 5425-5427.

  2. H. Erdinc Kocer and K. Kursat Cevik, "Artificial neural netwokrs based vehicle license plate recognition," Procedia Computer Science, vol. 3,

    pp. 1033-1037, 2011.

  3. A Roy and D.P Ghoshal, "Number Plate Recognition for use in different countries using an improved segmenation," in 2nd National Conference on Emerging Trends and Applications in Computer Science(NCETACS), 2011, pp. 1-5.

  4. Kaushik Deb, Ibrahim Kahn, Anik Saha, and Kang-Hyun Jo, "An Efficeint Method of Vehicle License Plate Recognition Based on Sliding Concentric Windows and Artificial Neural Network," Procedia Technology, vol. 4, pp. 812-819, 2012.

  5. Christos Nikolaos E. Anagnostopoulos, Ioannis E. Anagnostopoulos, Vassili Loumos, and Eleftherios Kayafas, "A License Plate- Recognition Algorithm for Intelligent Transportation System Applications," pp. 377- 392, 2006.

  6. Fikriye Öztürk and Figen Özen, "A New License Plate Recognition System Based on Probabilistic Neural Networks," Procedia Technology, vol. 1, pp. 124-128, 2012.

  7. Ch.Jaya Lakshmi, Dr.A.Jhansi Rani, Dr.K.Sri Ramakrishna, and M. KantiKiran, "A Novel Approach for Indian License Recognition System," International Journal of Advanced Engineering Sciences and Technologies, vol. 6, no. 1, pp. 10-14, 2011.

  8. R Zunino and S Rovetta, "Vector quantization for license-plate location and image coding," IEEE Transactions on Industrial Electornics, vol. 47, no. 1, pp. 159-167, 2000.

  9. Ying Wen et al., "An Algorithm for License Plate recognition Applied to Intelligent Transportation System," IEEE Transactions of Intelligent Transportation Systems, pp. 1-16, 2011.

  10. Yang Yang, Xuhui Gao, and Guowei Yang, "Study the Method of Vehicle License Locating Based on Color Segmentation," Procedia Engineering , vol. 15, pp. 1324- 1329, 2011.

  11. Yifan Zhu, Han Huang, Zhenyu Xu, Yiyu He, and Shiqiu Liu, "Chinese-style Plate Recognition Based on Artificaial Neural Network and Statistics," Procedia Engineering, vol. 15, pp. 3556-3561, 2011.

  12. Lihong Zheng, Xiangjian He, Bijan Samali, and Laurence T. Yang, "An algorithm for accuracy enhancement of license recognition," Journal of Computer and System Sciences, , 2012.

  13. Anton Satria Prabuwono and Ariff Idris, "A Study of Car Park Control System Using Optical Character Recognition ," in International Conference on Computer and Electrical Engineering, 2008, pp. 866- 870.

  14. Francisco Moraes Oliveira-Neto, Lee D. Han, and Myong K Jeong, "Online license plate matching procedures using license-plate recognition machine and new weighted edit distance," Transportation Research Part C: Emerging Technologies, vol. 21, no. 1, pp. 306- 320,

    April 2012.

  15. H. Erdinc Kocer and K. Kursat Cevik, "Artificial neural netwokrs based vehicle license plate recognition," Procedia Computer Science, vol. 3,

pp. 1033-1037, 2011.