Prototype for identification of vehicle plates and character recognition implemented in Raspberry pi

This paper presents the development of a prototype for the identification of license plates and character recognition implemented in a RASPBERRY PI 3 device. The device is used as a program controller, allowing to make a real time video from an integrated camera. From the video an image of the license plate is extracted, which allows to recognize the characters from it. Subsequently, the information of the license plates, current date, time, and camera code is integrated into a server which can be accessed from a web application. With this it can be achieved a systematic control of vehicles income and output.


Introduction
Artificial vision (AV) is a field of artificial intelligence (AI) that tries to create technological systems of optical recognition through methods that allow acquiring, processing and analyzing real-world images in order to produce information that can be treated by a machine [1].
An application of AV are the automatic recognition systems of vehicle plates (ALPR), these are composed by hardware and software allowing the reading of the vehicle plate and the recognition of the alphanumeric characters through optical character recognition techniques (OCR) [2].
This work presents the development of a prototype for the identification of vehicle plates and recognition of the characters it has, through the RASPBERRY Pi 3 electronic device. Its main functionalities are; automatic plate identification, character recognition using OCR, generation of the plate text and automatic sending of information to the server. The user interacts with the system through a web application that displays the information registered in the database, such as the date, time, photo and plate of the vehicle [3].

Related work
There are different investigations and projects related to the processing and analysis of images applied to the recognition of vehicular plates, now we presented the most relevant investigations.The work entitled "sistema de visión artificial para el reconocimiento de placas en vehículos particulares" developed by students of the University of San Buenaventura from Bogotá in 2008, this system allowed to identify the six characters of the license plate of the vehicle through the processing of the digital image, and in turn records the recognition data in an editable text file that contains additional information such as time and date of identification. The acquisition of the images was made through a webcam. Various image processing techniques were used such as color filters, morphological operations, growth of regions among others in order to achieve the location of the plate and the segmentation of the characters of the same. This work recommends the use of neural networks for future work [2]. Another important work is the "Sistema de visión artificial para la detección y lectura de matrículas" develop by the department of systems engineering and automation of the School of Industrial Engineering of the University of Valladolid. It arises from the idea of developing a system for the detection and recognition of license plates in automobiles. The main objective is to be able to use it in the control of access to parking, the camera when detecting the vehicle takes the image. It will consist of three blocks: location of the plate of the vehicle registration, treatment of the same and recognition of the characters. This algorithm was created to obtain satisfactory results regardless of the size and rotation that the plate may have. For the development of this work, the OpenCV open source library based on the C ++ programming language was used [4].
Finally, we can mention "3LPR" which is an automatic license plate recognition system (LPR system) used to identify and register the vehicles that access or leave a parking lot, achieving a great control of vehicle license plates, and therefore greater security. The system of automatic license plate recognition is not only focused on parking, but can be used in all those facilities that need to control, monitor and have a record of all vehicles that pass a certain access. Examples are the private garages of companies, shopping centers, tolls, hospitals, etc. [5].
There are several models of video cameras that incorporate recognition of vehicle plates, such as the camera HIKVision IP model DS2CD4A26FWDIZS / P that with a resolution of 2 megapixels and the use of a specialized algorithm ALPR, is used as a security element in accesses to parking lots and vehicle circulation areas. Its cost is usually relatively high; some can cost more than 4 times the price of a normal camera with similar characteristics.

Methods and Materials
For the realization of this work a series of tools and materials were used.

Rasp Raspberry PI 3
It is a complete computing system with good characteristics, which is commonly used for the development of embedded systems, due to its relatively low cost, its low power consumption, and its processing power, allows to build dedicated systems to solve problems that previously they required the use of computers. Figure 1 shows a Raspberry PI 3 that has pins that are unbuffered, that is, they do not have protection buffers, taking into account the above, you must be careful with the magnitudes (voltages, intensity, etc.) when you connect some components to them to avoid damaging the board, the different pins it has: Power pins, DNC (Do Not Connect), normal GPIO and special GPIO [4].

Figure 1. Raspberry-pi-3-model-b
This device in its web platform has several Operating Systems, which can be installed and configured in the optimal way for a good performance in the field that is required to use, some of the OS are: Raspbian (the most used), Ubuntu Mate, Snappy Ubuntu Core, Windows 10 IOT Core, OSMC, LIBREELEC, Pinet, RISC OS, Weather Station and Ichigojam RPI

Open ALPR
OpenALPR is a framework for image processing; modification and application of algorithms in images. Tesseract OCR is an open source software for character recognition that uses machine learning algorithms [7]. This library of recognition of open source automatic vehicle plates written in C ++ with This library already has the basic parameters configured for the detection of vehicle plates, which allows training for the recognition of plates with the formation of any country. This library, being open source, allows you to make modifications directly in your coding to make improvements or customize it for our needs.
OpenALPR relies on other libraries for its operation, these being: • OpenCV: this a framework for image processing; modification and application of algorithms in images. • OCR Tesseract: is an open source software for character recognition that uses machine learning algorithms.
Automatic License Plate Recognition (ALPR) is a mass surveillance method that uses optical character recognition in images to read vehicle license plates as a special set of hardware and software components.
The automatic license plate recognition process is divided into two main steps: plate detection and plate recognition. The first step is to detect the location of the plate in the entire frame of the camera. When a plate is detected in an image, the plate segment is sent to the second step, which is the recognition, which uses an OCR algorithm to determine the alphanumeric characters on the plate [2].
Three additional steps that are commonly used in pattern recognition algorithms are defined: • Segmentation: detects and removes each region of interest in the image. • Feature extraction: extracts a set of characteristics or variables from a region. • Classification: classifies each image region into "plate" or "no plate" in the plate detection step [8][9].

Open ALPR
For the recognition of vehicle license plates, OpenALPR was implemented, which analyzes images and video sequences to identify vehicle plates, this introduces in its encoding libraries that is based on computer vision techniques, powerful, such as OpenCV and Tesseract OCR, which are open source and handle automatic learning algorithms. A web application was developed to capture data and manage information. Figure 2 shows the detection of the region that contains the license plate by applying OpenCV functions.
Then apply a segmentation to obtain characters in the registration and recognition or identification of the car registration number by tesseract-ocr. In Figure 3 the interface where the vehicles that have

Results
For the elaboration of the algorithm, several libraries that specialize in artificial vision were tested. The library selected was OpenALPR that allows to implement artificial neural networks for image processing, the process of retraining of the neural network was done with a new set of images of vehicular plates.
The tests were carried out with batches of 16 plates, of images taken at different angles and at different times of the day. Each plate is formed by six characters of which 3 are letters and 3 are numbers. Three conditions were presented in which the algorithm was tested, these are: Diagonal image, Front (normal) image and deteriorated plate image.
The result of the diagonal image tests indicates that these plates could not be recognized by the algorithm because the plate could not be extracted from the complete image, normally this occurs because the images have an angle of inclination greater than 30°.
In the case, in which the image is taken from the front, a percentage of success was obtained 81% of the time, the remaining 19% that presented an error, there was an average of two erroneous characters er plate and with a maximum of three error characters on a single plate. The deteriorated plates were recognized by the ANPR algorithm and the image plate was obtained. In the recognition of the OCR some characters are recognized, this is due to the fact that no uniform tone is found on the plate.
Additionally, a tendency to produce errors was identified because the algorithm was not trained with the characters of the plate divided between letters and numbers, so the error increases with the letters that have similarity with numeric characters, for example, A and 4, O and 0, I and 1 among others.

Conclusions and recommendations
A prototype of vehicle plate identification and recognition was built, automating the process of information registration through the OpenALPR library that is installed from the Raspberry PI device. Additionally, a user interface was developed to facilitate the queries of historical data of the vehicles that have entered.
For future work it is recommended to improve the training process of the character recognition algorithm, testing with a larger set of images containing vehicles with Colombian license plates. To Expotecnología 2018 "Research, Innovation and Development in Engineering" IOP Conf. Series: Materials Science and Engineering 519 (2019) 012028 IOP Publishing doi:10.1088/1757-899X/519/1/012028 5 discard the recognitions that do not correspond to vehicle license plates, it is recommended to indicate to the algorithm how the vehicle license plates are made in Colombia (3 letters -3 numbers), and if it is a motorcycle it is formed by three letters, two numbers and a letter at the end.