Efficient Vehicle Detection System using OCR and REST API

– Number plate recognition has been one of the active and challenging research areas in the field of image processing and character recognition. It has numerous application which includes, law enforcement, fake vehicle registration, traffic control and electronic toll collection.In this paper an attempt is made to recognize characters in number plate using OCR through REST API.The vehicle plate image is obtained by the digital cameras and the image is processed in REST application program interface (API) to get the number plate information. In this context, the number plate area is recognised using Optical Character Recognition. The results show that the proposed system yields good recognition rates which are comparable to that neural network based number plate recognition.

INTRODUCTION Number plate recognition has been one of the most fascinating and challenging research areas in field of image processing and pattern recognition in the recent years. It contributes immensely to the advancement of automation process and improves the interface between man and machine in numerous applications. Several research works have been focusing on new techniques and methods that would reduce the processing time while providing higher recognition accuracy [1].
In general, character recognition is classified into two major categories, namely online and offline character recognition methods. In the online character recognition, the segmented image is recognised using OCR. In the online system, the two dimensional coordinates of successive points are represented as a function of time. The online methods have been shown to be superior to their offline counterparts in recognizing characters due to the temporal information available in it [2].
Offline character recognition is comparatively a difficult task, as different countries exhibit different font styles in number plates. Currently, the offline character recognition systems are primarily developed for recognizing machine printed and Handwritten texts. Documents entail special consideration as it involves recognizing the character written with varying styles [3]. The vehicle detection system works in three steps, the first step is the detection and capturing a vehicle image, the second step sends the image to the REST API server where the following process takes placeextraction of number plate in an image, segmentation and character recognition using OCR, the third step compares the processed data with the firebase real time database and then the notification is sent through fast2sms. The system must deal with different angles, distances, scales, resolutions and illumination conditions. Several character recognition techniques have been reported in the literature [4]. The widely used methods are template matching, deformable templates, unitary image transforms.H.E. Kocera proposed vehicle license plate recognition system based artificial neural network algorithm [5].In this system, the binary image is used as the input for the training network and the maximum recognition accuracy obtained is 95%.JianbinJiao [6].presented a survey on License plate recognition from still images and video sequence. The region of interests was extracted using edge statistics, morphology and connected component analysis. Babu et al [7], presented a feature based approach for license plate recognition of Indian number plates wherein the images were pre-processed to improve the image quality and were processed using median filters for noise reduction.Hirabara et al [8],presented a two level based character recognition method using dynamic zoning selection scheme for feature extraction technique .Aradhya et al [9],proposed a multilingual character recognition system by combining the PCA method and Fourier transform and which is compared with conventional PCA method.Agrawal et al [10], presented the design of automatic license plate recognition using raspberry pi.This system uses a camera along with the LCD display circuit interfaced to a raspberry pi.Hui Wu [11], proposed a method to find horizontal and vertical difference to find exact rectangle with vehicle number.Donoser et al [12], introduced a real time framework that enable detection, tracking and recognition of license plates from video sequences. Their detection algorithm is based on the analysis of a maximally stable external region detection that differentiates the region of interest on the basis of intensity of the region as against the boundary of the region.The reported works motivated the authors to propose a new technique called OCR based recognition technique and compare the recognition accuracy with conventional methods. It has been found that OCR technique outperforms the conventional methods.
In this paper OCR based number plate recognition system through REST API is proposed. This approach combines four different modules namely REST API, POSTMAN,FIREBASE REALTIME DATABASE, FAST2SMSto produce the best possible recognition accuracy.The best combination for recognizing number plate information is identified and the results obtained are presented and discussed.
The rest of the paper is organised as follows. In section II, the proposed Vehicle detection system is presented. Section III presents the experimental results and comparative analysis and finally the paper is concluded in section IV.

PROPOSED VEHICLE DETECTION SYSTEM
In this section, the proposed detection system is described. Vehicle detection system consists of four modules they are RESTAPI, Postman, Firebase, Fast2SMS. The general schematic diagram of proposed system is shown in

A.REST API
REST API is an application programming interface that uses HTTP requests such as GET and POST. It revolves around resource where every component is a resource and a resource is accessed by a common interface using HTTP standard methods [13]. REST Server provides access to resources and REST client accesses and modifies the resources. Here each resource is identified by URIs/ global IDs. REST uses various representation to represent a resource like text in JSON, format. GET method is used to extract information from the server using a given URL. POST request is used to create a new entity. It can also be used to send data to the server, for example customer information, file upload etc. using HTML forms. REST API works by breaking down a transaction in order to create small modules. Now, each of these modules is used to address a specific part of the transaction.REST API isalso referred to as web service and it is based on representational state transfer, an architectural style and approach to communication often used in web services development. It is logical choices for building API that allow users to connect, manage and interact with the cloud services. REST leverages less bandwidth, making it more suitable for efficient internet usage. REST API server processes the image using OCR and the recognition system consists of pre-processing, segmentation, character recognition. The general schematic diagram of recognition system is shown in

B.PRE-PROCESSING
The pre-processing is a series of operations performed on the input image.It includes various processes like converting an image from RGB to grayscale image, removing noise from the image, enhancing an image etc. It allows a much wider range of algorithms to be applied on the input data and the aim of digital image processing is to improve the image data by suppressing unwanted distortions or enhances some image features important for further processing, although geometric transformations of images.It is the set algorithms applied on the images to enhance the quality suitable for segmentation [14].

C.SEGMENTATION
In the segmentation stage, an image of sequence of characters is decomposed into sub-images of individual character [15].The segmentation of input image into isolated characters is carried out in two steps namely, line segmentation and word segmentation. In line segmentation, the pre-processed image is scanned row wise and pixel values are summed for every scanned row in order to find the start line. If the sum is zero, the scan has to proceed to the next row. If the sum is not zero then that row is identified as the first row of the line. It is continued till again the sum is equal to zero. The row for which the sum is zero is treated as the end row of the line. This is repeated to first segregate the lines. From the lines, the characters are segregated. This is done column wise using the similar procedure. This process is repeated for all the lines to obtain the individual characters. Finally, each individual character is uniformly resized into 40X30 pixels by preserve the image aspect ratio to extract the features. In the proposed system, it is the process of assigning a label to every pixel in an image such that pixels with same label share certain characteristics. This labelling provides information about the number of characters in an image.

D.CHARACTER RECOGNITION
Character recognition is a process of recognizing the individual character from input image with the help of database stored for each and every alphanumeric character.Finally optical character data changed over into encoded content [16].

E.API TESTING
API TESTING is a software testing type that validates Application Programming Interfaces (APIs) [17]. The purpose of API Testing is to check the functionality, reliability, performance, and security of the programming interfaces. In API Testing, instead of using standard user inputs (keyboard) and outputs, you use software to send calls to the API, get output, and note down the system's response.

F.POSTMAN
Postman is the only complete API development environment. Itis an API Testing tool that enables us to send a request to a service and get a response from it. It is used to test and implement the REST API, this is act as the client configured environment to send or receive data directly from the server through GET, POST methods The comprehensive set of built-in tools support every stage of the API lifecycle so individuals and teams can easily maintain a single source of truth. You can design and mock, debug, test, document, monitor, and publish your APIs from the Postman UI. Postman allows you to manage your APIs on the Postman native apps for MacOS, Windows, and Linux, with Newman, Postman's command line tool, and via the cloud using Postman Monitoring. Postman Collections are the most common API specification format and are at the core of every tool within Postman. This makes it easy to save and reuse your work throughout each stage of the API life-cycle. Collections also allow you to collaborate with team members on Postman. Postman recently added private and team Workspaces to make sharing and privacy easier. Team Workspaces are the ideal locale for teams to support current development and collaboration

G.FIREBASE
Firebase provides a real-time database and back-end as a service. The service provides application developers an API that allows application data to be synchronized across clients and stored on Firebase's cloud [18]. The company provides client libraries that enable integration with Android, JavaScript, Java, python, Swift and Node.js applications The database is also accessible through a REST API and bindings for several JavaScript frameworks such as AngularJS, React, Ember.js and Backbone.js. The REST API uses the Server-Sent Events protocol, which is an API

International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181 http://www.ijert.org for creating HTTP connections for receiving push notifications from a server. Developers using the real time database can secure their data by using the company's server-side-enforced security rules. All Firebase real time Database data is stored asJSON objects and it is cloudhosted JSON tree. When you add data to the JSON tree, it becomes a node in the existing JSON structure with an associated key

ANALYTICS AND ALERTING
To set up analytics and alert systems, Postman offers predefined integrations with external services [19]. By tying Postman monitors to your analytics systems, you can evaluate API health, performance and usage over a period of time. There are also integrations with notification systems which can alert you whenever monitor runs fail. Beyond these, you can always include requests in your collection that push data to third-party services.

FAST2SMS
It is a platform to send bulk SMS.Bulk message means sending SMS to one or more recipients via software/API/web platforms .Fast2sms provides free SMS for testing.Scheduled and Customized SMS can be sent easily in Fast2sms

3.RESULTS AND DISCUSSION
The Efficient vehicle detection system gives a brief discussion about the results obtained. This output is generated when the image captured by the camera is sent to the REST API server where the number plate information is extracted and compared with the firebase database. For fake vehicle, the extracted information and the firebase information does not match, therefore the Fast2SMS server sends the fake number plate message to the nearest judicial or toll. extracted information and the firebase information matches only with the number plate information but it doesn't match with the color information of the corresponding vehicle, therefore the Fast2SMS server sends the fake color message to the nearest judicial or toll. This output is generated when the image captured by the camera is sent to the REST API server where the number plate information is extracted and compared with the firebase database. For proper vehicle without insurance, the extracted information and the firebase information match only with the number plate and color information but it doesn't match with the insurance information and also provides whether the insurance is paid or not, if not, then the fine will be added to insurance amount, therefore the Fast2SMS server sends the insurance fine message to the vehicle owner. In this section, the accuracy of individual stage in number plate recognition process is evaluated and shown in Table 1 given below. The processing time for the proposed detection system is calculated and found to be 128ms for most of the database images, which is fairly acceptable for the real time application of the number plate recognition system.

4.CONCLUSION
In this paper, the automatic vehicle identification system using vehicle number plate is presented. We were successful in identifying the characters of an number plate which consists of alphanumeric characters. The system uses series of image processing techniques like OCR for identifying the vehicle from the firebase real time database. As a result, the proposed system will be less complex compared to the recognition using Artificial neural network. The recognition accuracy achieved in the proposed vehicle detection system is 95.16%. This system has applications in many fields like automatic toll collection and handling, parking fee payment, traffic monitoring, vehicle tracking, surveillance system and access control etc. The system can be deployed on a standalone system as well.