Efficient Vehicle Detection System using OCR and REST API

DOI : 10.17577/IJERTV9IS070306

Download Full-Text PDF Cite this Publication

Text Only Version

Efficient Vehicle Detection System using OCR and REST API

  1. Pradeep, A. Muthukumaran, G. Nareshraman, R. Krishnan and B. Sakthy Rosseou Prasanna

    Department of Electronics and Communication Engineering, Sri ManakulaVinayagar Engineering College,

    Pondicherry, India

    Abstract 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.

    Keywords:- Optical Character Recognition, Efficient Vehicle Detection System, REST application program interface

    1. 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.

    2. 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 Fig 1.

      Input image

      Input image

      REST API

      (Image is processed)

      REST API

      (Image is processed)

      \

      The Processed data is compared with data in firebase

      The Processed data is compared with data in firebase

      If any mismatch is found notification is sent through FAST2SMS

      If any mismatch is found notification is sent through FAST2SMS

      Fig 1. Schematic diagram of the proposed vehicle detection system

      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 connct, 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 Fig 2.

      Image acquisition

      Image acquisition

      Pre-processing

      Pre-processing

      Number plate extraction

      Number plate extraction

      Segmentation

      Segmentation

      OCR for Character Recognition

      OCR for Character Recognition

      Fig 2.General recognition system

      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

      Fig 3. IMPLEMENTATION OF REST API

      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

        1. IREBASE

          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

          Fig 4. FIREBASE REALTIME DATABASE

          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

          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 cloud- hosted 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 pre- defined 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.

      Proper Vehicle

      Fig 5.Output of Proper Vehicle

      Fig 5 displays output of the proper vehicle to the vehicle owner. 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, the extracted information and the firebase information matches,

      therefore the Fast2SMS server sends the welcome message to the vehicle owner.

      Fake Number Plate detection

      Fig 6.Output of Fake Number Plate

      Fig 6 displays output of the fake number plate detection 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 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.

      Fake Vehicle Color Detection

      Fig 7.Output of Fake Vehicle Color

      Fig 7 displays output of the fake vehicle color detection 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 with the firebase database. For fake vehicle color, the

      extracted information and the firebase information matches only with the number plate information but it doesnt match with the color information of the corresponding vehicle, therefore the Fast2SMS server seds the fake color message to the nearest judicial or toll.

      Proper Vehicle Without Insurance

      Fig 8. Output of Proper Vehicle Without Insurance

      Fig 8 displays output of the proper vehicle without insurance to the vehicle owner. 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 doesnt 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.

      Features

      Plate Extraction

      Character segmentation

      Character Recognition

      Total images=102

      99/102

      98/102

      97/102

      Accuracy

      97.06%

      96.07%

      95.1%

      Features

      Plate Extraction

      Character segmentation

      Character Recognition

      Total images=102

      99/102

      98/102

      97/102

      Accuracy

      97.06%

      96.07%

      95.1%

      TABLE 1. ACCURACY OF PROPOSED VEHICLE DETECTION 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.

    5. REFERENCES

      1. S. Mori, C.Y. Suen and K. Kamamoto, Historical review of OCR research and development, Proc. of IEEE, Vol. 80, pp. 1029-1058, July 2016.

      2. R. Plamondon and S. N. Srihari, Online and offline character recognition: A comprehensive survey, IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol.22, no.1, pp. 63- 84, 2001

      3. V.K. Govindan and A.P. Shivaprasad, Character Recognition A review, Pattern Recognition, Vol. 23, no. 7, pp. 671- 683, 2007.

      4. H. ErdincKocer and K. KursatCevik, Artificial neural networks based vehicle license plate recognition, Procedia Computer Science, Vol. 3, pp. 1033-1037, 2011

      5. Jianbin Jiao, Qixiang Ye and Qingming Huang, A configurable method for multi-style license plate recognition, Pattern Recognition, Vol. 42, no. 3, pp. 358-369, 2009

      6. Babu et al, Feature based approach for license plate recognition of Indian number plates, International Journal ofAdvances in Computer Science and Communication Engineering, Vol. 2,pp.533-546 June 2014.

      7. Hirabara, Simone and Cinthia, Dynamic zoning selection for character recognition, Progress inPattern Recognition, Vol. 7042, pp.507-514,2011.

      8. Aradhya, Hemanatha and Noushanth, Multilingual OCR system for South Indian script and English Document: An approach based on Fourier transform and principal component 8analysis, Engineering application of artificial intelligence, Vol.21, no.4, pp. 658-668, 2008.

      9. Agrawal et al, Automatic license plate recognition using raspberry pi, IEEE Transactions on Pattern Analysis, Vol. 22, no. 1, pp. 63-84, 2000.

      10. Hui Wu and Bing Li, License Plate Recognition System, International Conference on Multimedia Technology, Vol.7, pp. 525-542,2011.

      11. Donoser and bischof, Real time framework in recognition of license plates, International conference on Education Technology, Vol.5994, pp.281-292,2009

      12. Zimmermann, Olaf, Leymann and Frank, REST web services architectural decision,17th International World Wide Web Conference, Vol.3, pp. 107-121,2008

      13. R.G. Casey and E.Lecolinet, A Survey of Methods and Strategies in Character Segmentation, IEEE Transactions on PatternAnalysis and Machine Intelligence, Vol. 18, No.7, pp. 690-706, July 2012.

      14. Muhammad Tahir Qadri and Muhammad Asif, Automatic Number Plate Recognition System for Vehicle Identification using Optical Character Recognition, International Conference on Education Technology, Vol.24 pp. 335-338,2009.

      15. Amy Reichert, Testing APIs protects applications and reputations, Search Software Quality ,Vol.35, pp.220- 235,March 2015

      16. Lardonis and Frederic, Firebase adds web hosting to its database platform, Proc of IEEE,Vol.15,pp.145-163,2014

Leave a Reply