Indonesian License Plate Detection Using Morphological Operation

Technological developments have enabled the use of vehicle number plate recognition in various fields such as parking systems, e-toll payments, handling motor vehicle theft cases, traffic violations and so on. Vehicle number plate characteristics in each country have characteristics that are not the same. Each country has a standard numbering system in its writing method, colour, language and size of the license plate, so that to take the research standards for license plate numbers from other countries is not effective. Special research is needed in accordance with the format of the number plate used by the country, in this case Indonesia. This research applies simple method, morphological operations in detecting vehicle plates in Indonesia. Morphological results will be segmented to get the image of the plate character separately. The test results show that the method applied can provide a maximum accuracy of up to 100% on taking plate images with a distance of 1.5 meters.


Introduction
Every country uses specific vehicle license plate recognition system. The vehicle license plate recognition system is one component of the intelligent transportation system [1] and is usually used for the control of traffic, traffic surveillance, monitoring against illegal activities, security control of restricted areas, traffic law enforcements, toll collection and parking management [2]. In Indonesia, this identification system has been used by the police in enforcing traffic law, even though the activities have not been fully carried out in each region due to the limitations of the vehicle's equipment and data that have not been synchronized. Parking system technology in Indonesia is currently growing along with the increasing public awareness of the environment and sustainability. Atomatic parking systems are important part of the environmental support systems. As the main support of parking system in urban areas, it is necessary to develop green infrastructure [3].
License plate recognition is an importan part in automatic parking system in urban areas. The license plate recognition system (LPRS) consists of two main technologies, which are the license plate positioning technology and the plate number recognition technology [4]. Plate number detection is part of license plate positioning technology and is very important to process LPRS effectively. Plate number detection and car image recognition can be a quite challenging task when the image acquisition is taken in different weather conditions, lighting conditions, angles, or various distances. There are several studies that try to find the best solutions in plate number detection, such as using artificial neural networks (ANNs) method in Korean vehicle plate detection [5], using SVM linear classification in china vehicle plate detection and Indonesian vehicle plat detection using combination  [6], histogram of oriented gradient (HOG) to license plate detection [7]. However, the method is time consuming because the complexity of computation.
This study proposes a simple morphological method for Indonesia license plate detection. Tests using morphological operations are also carried out in various ways to determine the effect of the distance of plate image taking on the results of segmentation. The proposed stage consists of three parts: image preprocessing, plate detection with extraction using morphological operation and character segmentation as stage to determine success.

Research Methods
The main process design of the system built is to use morphological operations to detect the plate area by ending the character segmentation process in the detection plate area. The general description of the system is shown in Figure 1.

Figure 1. Overview of the System
Image acquisition is done in a parking area with sufficient lighting conditions using a Samsung smartphone camera with 8 MP resolution. To support the research scenario, image acquisition is divided into 3 conditions, namely at different distances (1 m, 1.5 m and 2 m). Each distance consists of 11 plate images that are the same as the total image of all 33 images.

Figure 2. Image acquisition distance
Preprocessing stage is done to determine input according to the needs of the detection process. In this case because only one value is used in the process, three RGB channel values are put together by means of the image size of 640x480 acquisition pixels converted to grayscale images, using the grayscale formula to form the sum of R, G, and B components with the intention of removing hue information and saturation while maintaining luminance [8]. This grayscale formula is shown in Equation (1).
(1)  In the process of plate detection and extraction, this grayscale image is then converted to binary images and then analysed using morphological operations that produce the area that has the most potential as a candidate plate. At this stage, the thresholding value is divided by 2. If the detected pixel has a pixel value less than the threshold value, it will be converted as background. If it is greater than the threshold value, then it is converted as foreground. The purpose of morphological operations is to obtain information about the shape of an image by adjusting the shape and size of a structuring element. In its use, morphology always involves an image with component I (image) and E (structuring element) constituent elements. Morphology has two basic operators, namely Dilation (dilation) and Erosion (erosion) which are commonly used to extract the desired components in an image. Dilation is the addition of pixels to the boundary between objects in a digital image while erosion is the opposite of dilation. This process will make the size of an image smaller. Based on these two operators, two other operators can be derived which are useful for smoothing the subinterval boundaries of the extracted components, namely opening and closing [9].
Opening is a combination of processes where a digital image is subjected to erosion surgery followed by dilation. Opening operations on images have the effect of smoothing the boundaries of objects, separating previously held objects, and removing objects that are smaller than structural sizes. The morphological operation used in this study is image erosion shown in Equation (2) to remove connected components in the thresholding image using the 8x8 pixel strel rectangle. The opening operation is then shown in Equation (4) to remove small objects that are less than 30 pixels in size. Then after the opening, an image dilation operation is performed (Equation (3) which aims to fill holes, thickening objects with the size of structuring elements. In all the above operations A (x, y) are binary images and B (x, y) are structuring elements. Structuring elements are structural characteristics and certain features for measuring image shapes and are used to perform other image processing operations. In this approach, a rectangular arrangement element is used to erode the image with a radius of 8 * 8. Furthermore, the analysis of components that are connected to each other to get the plate area, with a ratio of plate length and width is between 0.1 and 0.42. Figure 6 shows the plate that has been detected. After the plate area is found, the plate is converted again to grayscale and binary to segment the character. Labelling is done to mark pixels that are connected to each other in the direction of 8 pixels. After that, the criteria are given that the area that is considered a character is an area with a minimum size of 20 pixels and the ratio of length / width is between 0.1 to 0.5. Furthermore, each character detected according to the criteria will be resized with a size of 30x20 pixels using the interpolation method. Interpolation method uses the average value of a region to represent its region. Figure 7 shows the character of the plate that has undergone segmentation.

Results and Discussions
The experiment was conducted to determine the successful rate for implementing the morphological operations on vehicle plate detection and find out the effect of distance in taking pictures on the final results of the study, namely the results of character segmentation in the plate. In this experiment, 33 images taken from the parking area were analysed and the size of all images was 640x480 pixels. All of them were taken by smartphone Samsung 8 MP camera under the same lighting conditions during the day (10 a.m. -1 p.m.) and varied distance from 1 to 2 meters with the camera focusing on the front part or the rear part of the vehicle in which expected license plate is located.   Table 1 shows the experiment result which is done by dividing the acquired distance into 3 category. From the experimental results, it was found that distance affects the accuracy of detection and plate segmentation with an average accuracy of 90.90% and the ideal distance is 1.5 m.  However, some license plates were not successfully detected. Table 3 shows example of plate detection process with succesful and unsuccessful result. In figure 8_3.bmp in Table 3 shows an example of a plate that was detected but was considered a failure because the segmented plate was less than perfect. Unlike the image 8_1 and 8_2 taken at a distance of 1 m and 1.5 m. Even though the image comes from the same vehicle as the image at 8_3.bmp, the plate is detected from both images. This shows that distance affects the accuracy of plate detection. From the Table 1, it can also be seen that the highest accuracy (100%) is at a distance of 1.5 m.

Conclusion
We have conducted a study to determine the impact of morphological operation in detecting Indonesian vehicle plate number. Using 3 types of distance conditions which is 1m, 1.5m and 2m to find out the most ideal distance in image acquisition for plate detection, we concluded that morphological operations can be applied to detect and segment characters on Indonesian vehicle plate number. Based on our observation, the ideal distance is 1.5 meters with an accuracy of 100% in a sufficient lighting conditions.