Recognition Design of License Plate and Car Type Using Tesseract Ocr and Emgucv

The goal of the research is to design and implement software that can recognize license plates and car types from images. The method used for the research is soft computing using library of EmguCV. There are four phases in creating the software, i.e., input image process, pre-processing, training processing and recognition. Firstly, user enters the car image. Then, the program reads and does pre-processing the image from bitmap form into vector. The next process is training process, which is learning phase in order the system to be able recognize an object (in this case license plate and car type), and in the end is the recognition process itself. The result is data about the car types and the license plates that have been entered. Using simulation, this software successfully recognized license plate by 80.223% accurate and car type 75% accurate.


INTRODUCTION
Nowadays, the amount of private car is increasing, which leads the increasing of traffic level.The vehicle theft is at high occurrence and parking lot for accommodating them in public place becomes lesser.Therefore, the queuing in parking lot is increasing.Based on data on reskrimum.metro.polri.go.id, there were 10.791 cases of vehicle theft in 2006 with national scale, while in the next year it increased into 11.620 cases.From the problem, there is a system that can ease the queuing in accessing toll and in the entrance of parking area to decrease the queuing in the entrance and also the exit.Besides that, it can also decrease the theft level because every vehicle that in and out are recorded and the data is saved to be accessed if it is needed to track missing vehicles.
The method used is recognition pattern with edge detection that is used to find the boundary of certain pattern in image.It is added with the usage of Artificial Neural Network (ANN) that able to learn and solve complicated connection, which is hard to be descripted between the input and output.

METHOD
The method used is divided into two main parts, which are analysis and design.Analysis method includes literature study about character recognition and artificial neural network.While the design method includes preparation requirement (reporting requirement), design, coding and continues with evaluation.

Automatic License plate Recognition (ANPR)
Based on the explanation from the previous research about recognition of license plate, it can be concluded that the detection is needed for life today.ANPR is needed in several fields like: checking the vehicle speed (vehicle with the speed over the limit, the license plate can be recorded automatically); parking area management (parking ticket, missing and vehicle theft, duration of fixed monitoring, audit, hands-free access); traffic management; controlling and monitoring access; control of vehicle obedient on road.

Artificial Neural Network (ANN)
Neural network is network from group of small processing units that is modeled based on human's Artificial Neural Network (ANN) [1].ANN is adaptive system that can change its structure to solve problem based on external or internal information that flows in the network.

Fig. 1: Artificial Neural Network
The understanding model is based on the assumption: (1) Information delivery process occurs on simple element known as neuron.(2) Information connection among nerve through connector (layer in ANN model).( 3) Every connector has weight from the previous calculation result.The calculation is done using multiplication every passing weight.
ANN distributes in several layers with the amount of input that will produce output, between the input and output, there is hidden layer.Every connection between input to output is nodes that have weight.Image training process is done in this process if there is input image so the system will recognize the entered object.Training can be done many times, the more training, the more accurate the recognition system.

Computer Vision
Computer vision is process to obtain, process, analyze and understand the image [2].Generally the processed image is image with high dimension in real world, in purpose to obtain information in number or symbol.
Computer vision system can replace human's duties and make the system more modern.In scientific study, computer vision is the theory of artificial system that extracts information from image.While in technology study, computer vision finds theory and model from construction that is captured by image.
In plate recognizer, the branch of computer vision is used, which is Optical Character Recognizer (OCR), functions to identify number and letter from the plate.

Image Processing
Image processing is on the image definition, and the processes are as follow [3]: (1) Image; image is two dimensional images that are produced from analog image of two dimension, which is continuous into discrete image through sampling process.Analog image is divided into N row and M column then it becomes discrete image.The crossing between row and column is known as pixel.For example is image or discrete point on row N and column M is known as pizel [n,m].(2) Sampling; sampling is process to decide color in certain pixel on image from a continuous image.On sampling process, it is common searched for average color from analog image that then be rounded.Sampling process is also known as digitization.(3) Quantification; occasionally in sampling process, the obtained average color is realized to certain color level.For example if in image there is only 16 levels of grey color, then the obtained average color from sampling process has to be associated to the 16 levels.Association process of average color with certain color level is known as quantification.(4) Noise; noise is image or pixel that interfere the image quality.Noise can be caused by physical disturbance (optic) on acquisition tool or intentionally caused by unsuitable process.For example black or white dot that appears randomly; and it is unwanted in image.The random dot is known as noise salt & pepper.A lot of methods in image processing aim to decrease or relieve noise.
It can be said that image processing is an activity to fix image so it can be interpreted by human or machine (computer).The input is image and the output also in image form but with better quality form the input image.The purpose of image processing is the information that is delivered by input image conveyed and can be processed by human / machine (computer).The conversion of image color from RGB (Red, Green, Blue) becomes gray.An image will be changed into matrix N x M array, then with the changing color so it can be obtained value from every array element that can be said as image element or pixel (picture element).For a digital image, every pixel has its integer value or known as gray level that shows intensity from pixel.

Grayscaling
Grayscale digital image is image, which the value of each pixel is single, only has description with intensity [4].This kind of image is also known as black-and-white image, which specially consists of gray color, with variation from black on the weakest intensity to white on the strongest part.
Grayscale image is different from one bit bitonal on black-and-white image that on the computer image context is image that only has two colors, black and white (also known as bilevel or binary image).Grayscale image has many shades of gray.Grayscale image is also known as monochromatic that shows only one (mono) color (chrome).
Grayscale image is also result of light intensity measurement on every pixel as single tape from electromagnetic spectrum (such as infrared, visible light, ultraviolet, etc.), and in this case grayscale image is on the right monochromatic when the given frequency caught up.However the thing can be synthesized from colorful image.
Conversion from color to grayscale is not difficult, the different weight from color channel effectively represent effect from black-white image with various photography filters on camera.The common strategy is matching the exposure from grayscale image with the colored image exposure.
To convert color, things needed with a grayscale representation of an exposure are firstly we have to obtain values from red, green and blue (RGB) primary encoding with linier intensity from gamma expansion.For the sRGB room, the gamma expansion is defined as: CsRGB is one of three primer gammacompression sRGB in range [0,1] and Clinear is linear intensity value that suitable (in range [0,1]).Then the exposure is calculated as the amount of weight from three linear intensity values.For ITU-R BT.709 primer, like being used in sRGB, the weight of Y = 0,2126 R + 0,7152 G + 0,0722 B gives CIE 1931 exposure.Linear exposure usually needs a gamma that is compressed to be returned to a conventional grayscale representation.By coding the grayscale intensity RGB, each of three primers can be regulated so it can be same with the exposure that will be calculated.For sRGB, the suitable gamma compression is: This is not method that is used to obtain luma on Y' UV and color model that is used on TV standard color as PAL, SECAM and NTSC.The system directly counts gamma that is compressed by luma as linear combination from compressed gamma by primer intensity than using expansion linearization through the use of gamma and compression.On YUV and YIQ model, it used by PAL and NTSC, the luma component (Y') counted as: The coefficient represents the human perception of color, particularly that humans are more sensitive to green and the most sensitive to blue.The model used for HDTV is developed by ATSC using the color coefficient that slightly different, the calculation of luma component described as:

Canny Edge Detection
Canny Edge Detection is an edge detection operator that uses multi-stage algorithm to detect the edges in the image.It was developed by John F. Canny in 1986.Canny also gave a theory of edge detection computational that explained why this technique works.

OCR (Optical Character Recognition)
Optical Character Recognition (OCR) is branch from computer vision.OCR is recognition towards characters whether in letter (big and small) and also number.This technology will enable machine automatically to recognize the character through optic mechanism [5].OCR technology is widely used to convert books and documents into electronic or digital form.OCR enables the user to edit text and recognize motor vehicle.OCR needs setting to read the font specifically, the smart system works with high accuracy especially if the used font is common font.Generally the recognition process through OCR is explained on diagram.Segmentation process is done by separating the object region with the object background, so the image is easily analyzed for object recognition.
The next process is normalization that has two processes, which are: Scaling is function to change size an image, where scaling is a term that tends for maximizing image and shrink for minimize the image.The second process is thinning, morphology process that is used to erase selected foreground pixel from binary image.It is usually used for the process of searching for the bones of an object.The next step is feature extraction.Feature extraction is an image analysis process in identifying the naturethe inherent properties of each character or known as, the features of an object contained in the image.The characteristic is used to describe an object or attribute of an object, then the features that can be used as a character used as recognition process.After the steps above have been done, then OCR is ready to perform recognition stage and will give the output or result of character recognition in digits and letters.

Tesseract OCR
Tesseract is OCR engine open source that firstly developed by HP (Hewlett-Packard) in 1984-1994.At first tesseract was Ryan Smith's object research in HP lab in Bristol.Fig. 4: Tesseract Architecture Tesseract reads the received input in the form of a binary image.Analysis is performed on the connected components to determine which outline the components that will be saved.Outlines gathered together and become blob.Blob organized into lines of text, while the lines and regions analyzed to be fixed pitch and proportional text.Line of text is divided into words by character space.Text with pitch divided each character cell, then the text proportional split into words using fuzzy space.
The first pass separating the words that already exist in the database, and the second pass is a recognition word in image.

Recall and Precision
Recall is the ratio of the number of documents that can be retrieved by a searching process in the relevant image system [4].The formula of the recall is the amount of relevant documents are found divided by the amount of all relevant documents in a collection or can be elaborated by: Where the relevant documents and available documents divided by the number of documents.
Precision is the proportion of the number of documents found and considered relevant for the needs of the information seekers.The formula of precision is the number of relevant documents that are found divided by the number of all documents found, where the relevant documents and derived from documents divided by the number of documents that wish to be identified.

The Used Method
In the process of character identification on the license plate and vehicle type finds many obstacles.The encountered problems are the segmentation process that should be appropriate to determine the license plates of vehicles, tolerance to existing noise in the license plate image, font types and modifications on the vehicle license plate, adequate lighting so that the image can be recognized and position image retrieval.For lighting problem, it will be limited image acquisition, which is done with adequate lighting, so it can be identified clearly and reducing noise.For the font type and plate modification, it will be done character recognition, a process that is commonly used.Problems in training car; so as not to cause a lot of errors, the training will be conducted for three types of cars that will be recognized based on the basic shape and height of the car and classified into sedan, MPV and truck.
Another problem is the problem of segmentation in character, making it difficult to perform manual training to recognize the character.The solving problem is by using OCR from Tesseract contained in the EmguCV library.

Steps of Troubleshooting
Steps that will be done consist of three stages: pre-processing, training process and the process of identification.Broadly speaking, the system will be designed as follows: The first stage is the user inputs car image into the program.After the image is inputted, the program will read and perform pre-processing process, which is the process of image processing from bitmap into an array of 7x7 to the inputted image.After the preprocessing successfully executed then entered the training stage, which is system learning phase in order to recognize an object (in this case license plate and car type).After that the next process will be done recognize process, namely the process of introduction of a system that has previously been trained.After all the process is successful the result will show the introduction of the type of car and license plate of image that has been previously entered.In the diagram above describes the process by which a received image of the car will be done the detection by taking part to be known as the license plate area.After obtaining the license plate area, then it will be done segmentation process towards the car plate, which is the process of separating the image plate from the image.The results of the segmentation plate will be re-segmentation of the license plate characters.After getting the extraction of character, it will be directly included in the license plate character recognition stage of the car's image.In the above diagram is explained that the recognition of the car type is done through sampling and grayleveling process first.After going through the process of sampling and grayleveling, it will be the training process to the image.After the training process of the image is completed, the training results can be saved for reuse.The diagram above is the identification of the type of car flow, to perform recognition on the image of the car, we need to do the sampling and grayscaling process again so that the image can be more easily recognized.After performing the sampling and grayscaling process, it will be continued with noise removal and then will be identified through ANN that has been in training in the previous process.After the recognition by ANN, then the car type of image can be recognized.

Detection and Extraction Plate Number Sampling
The inputted pictures of cars will be sampling.As well as on the theory that the sampling is the process of changing array (matrix) size NxM matrix and each element has its own value.Pictures will be read and then opened with imshow function.The results of these images will be sampling using 7x7 matrixes.

Fig. 9: A Car Original Image
The image that has been through the process of sampling will be converted from RGB to gray or grayscale with level of 28 or 256.

Rectangle Detection
By utilizing the special characteristics of the license plate is rectangular, and then the next step is the rectangle detection.In this rectangle detection process relies on the detection of a line that has been done before as constituent of the rectangle is a collection of lines.It is used rectangle detection to search for a candidate vehicle license license plate because the physical plate form in Indonesia, which supports and is easily recognizable as a rectangle.
Rectangular detecting process is to check towards the two lines are parallel.Then the adjacent lines will be connected to form a parallelogram.Furthermore, the formed parallelogram will be marked as rectangle and normalized angle to 90 degrees.
The results of this rectangle detection generate several candidates as input for the selection process license plate.

Selection of License plate
The selection process of license plate is done by selecting the rectangle that has been detected in the previous stage by using the formula plate ratio = length / width.
The next is after the process of division, it is defined limitation to determine which plate will be selected.The limit is by checking whether the detected rectangle has a character or not.Assuming the license plates have at least 5 characters, then if it is less than 5 characters means it is not included in the license plate region.

Recognition
Character recognition process will read the license plate characters contained in the image by calling the Tesseract functions contained in the EmguCV library.After the character is known, it will be displayed on the output of the textbox.There are two stages, namely: noise filtering and recognition.

Noise Filtering
This process is necessary to fulfill the required parameters for the next process, which is Optical Character Recognizer (OCR).This process is done to fix the license plate so that the object can be inserted in the recognition stage.
This process uses canny edge detection, so that the edges of the numbers and letters character are detected.Furthermore, it is used erosion and dilation process.
Erosion and dilation can be performed simultaneously or even themselves depend on the results we obtained are sufficient to meet the expectations or not.The expected result is each character is subjected to this process forming a valid result.
Erosion and Dilation is used together to unify the separated pixels so ti can clarify the form of letters or numbers and also eliminate noise powder in pixels.

Plate Recognition
Once the noise is eliminated through the process of noise filtering, then it is ready for recognition stage.The license plate recognition stage uses Tesseract OCR engine.(3) Separation of Connected Character.If there are overlapping in the character segmentation result, it will be fixed in this stage.The formed overlap blop will be separated.Candidate for the separation point is found on the concave vertices of polygonal outline approaches and there may be more opposite concave point or line segment.(4) Broken Character Association.If the overlapping character has been successfully separated, check wheterher there are characters that broken or slightly damaged.If there is, the outline of the defective character will be repaired using the best first search.(5) Adaptive Classifier.Featured is a polygonal approach component from a shape outline.In the recognition, the polygon elements are broken down into the shorter sections of equal length, so that the long dimension of the feature vector is eliminated.Some short features are matched with some prototipkal features of training that has been done by Tesseract in .traineddatafile.It makes the clarification process more robust to the lost character.In this stage the character of the plate fitted with the prototype of the characters in the training Tesseract data.When approaching the similarity then the character will be displayed.(6) Recognition Result.If the matched characters are close to the resemblance with the prototype character in the training Tesseract data, then the character will be displayed.The recognition result of license plate characters is as follows.Image, which should be opened, is a digital image that contained the vehicle license plate, and it must be larger than 240x180 pixels because this size can produce accuracy level that is better than Tesseract ocr.

Training Car Type
The training process will be done through artificial neural networks with back propagation method, which after the image through the preprocessing stage the image will be trained, based on the area and height of the car.With some done training, then the system will recognize the type of car based on the digital image input.
The numbers of images that will be used as training sample as many as 16 samples, which consist of 8 cars with background image and 8 cars without background image.Here are the used samples: (1) 80,223%.Automatically then it can be obtained failure rate of this program is approximately 20%.From the analysis, the failure detection caused by several things, namely: the position of the license plate is too far and too close to the plate not detected, the condition of the damaged plate and the effect of poor lighting or too bright.As for the recognition of the car type program has an accuracy rate of 75%.

CONCLUSION
Based on the results of testing to 30 car types that have been implemented in the program, it can be concluded that: This program has reliabilities such as: (1) Time detection and its character recognition of existing numbers and letters on the plates can quickly be recognized by the average time less than 500 milliseconds.(2) All the edges that is considered as square will be detected so that the candidate license plate will not be missed.(3) The program can recognize the car type globally (MPV, sedan and truck).
The program also has its drawbacks include: (1) Unable to detect the modified plate or damaged plate, for example faded plate.(2) Unable to detect all sizes plate, only a certain length and width that can be detected perfectly.Thus the plate recognition system and the car type are not strong enough (robust) in terms of detection, license plate recognition and the type of four-wheeled vehicles.

Fig. 3 :
Fig. 3: Diagram of OCR Process is a library open source cross platform.EmguCV can call functions of the OpenCV library in image processing.EmguCV is compatible with many programming languages, such as C ++, C #, VB, IronPhyton and others.EmguCV can be run by various OS such as Windows, Linux, and MacOS.The advantages of EmguCV are: (1) Cross-Platform: unlike other wrappers that are written in unsafe code.EmguCV writing is written in C#. (2) Compatible with many programming languages: can be used in many programming languages such as C ++, C #, VB and IronPhyton.(3) Compatible with a wide range of Operating Systems: can be used in various kinds of OS such as Windows, Linux and MacOS.(4) There is a drawing class with generic colors and has a depth.(5) Can use the functions of OpenCV.

FinishFig. 6 :
Fig. 6: Diagram of Extraction Flow In Pre-Processing and Character Identification

Fig. 7 :
Fig. 7: Diagram of Pre-Processing Flow and Training Car Type

Fig 11 :
Fig 11: Car Image that has done License plate Selection

Fig. 15 :
Fig. 15: The Recognition Result of License Plate Character (1) The program can detect and recognize the license plate of four-wheeled vehicle with an accuracy of 80.223%.(2) The program can detect and identify the car type with an accuracy of 75%.(3) The program can detect and recognize the license plate number and car type using soft computing with an accuracy of 80%.

( 3 )
The detection of the car type should take a long training process.(4) The recognition of the car type should be the image at the corresponding position.(5) Uncertainty as to the composition of the amount of input, hidden and output layers in obtaining optimal training results.

Table 1 :
Calculation Character Plate