A UTOMATIC I RAQI C ARS N UMBER P LATES E XTRACTION

- License Plate Recognition (LPR) system becomes an important research issue in recent years due to its importance to wide ranges of commercial applications. The first and the most important stage for any LPR system is the localization of the number plate within the vehicle image. This paper presents a methodology for Iraqi cars number plates extraction from the vehicle image using two methods, the first one is morphological operations and the second method is edge detection. The main idea is to use these two different methods in such away so that the number plate of the vehicle can be extracted precisely. These algorithms can quickly and correctly detect and extract the number plate from the vehicle image although there was a little noise in the image. This paper also makes a comparison between the two methods of extraction in results. The software that used to build the systems is MATLAB R2014a.


I. INTRODUCTION
Nowadays vehicles play a very important role in transportation. Also the use of cars has been increased because the growth of population and human needs in recent years. Therefore, control of cars is becoming a big problem. Automatic Iraqi cars number plates' localization system using intensity detection with morphological operations and edge detection is proposed in this paper for the purpose of effective control. License plate localization system is a form of an image processing systems used to extract the vehicle number plate from the stop vehicle image to be recognized later. The camera that used to capture the images is not connected to a computer. Since every car carries a unique license plate (LP), so there is no external cards, tags or transmitters need to be recognizable, only license plate. In Iraq, there are three styles of the license plates written in Arabic language. The first style is for the three Northern provinces (Erbil, Sulymania and Duhok) as shown in Fig.1a, the second style is the old style (before 2003) shown in Fig.1b, and the third style is the new style which is shown in Fig.1c. The second and third style is used for the other fifteen provinces and each has a different size and design. This paper is organized as follows: Related Work is described in section 2, the algorithm of number plate extraction using morphological operations is explained in section 3, the algorithm of number plate extraction using sobel edge detection is explained in section 4 and Experimental Results are described in section 5. Finally, Conclusions and future work are summarized in section 6.

II. RELATED WORKS
Several techniques have been developed for the license plate localization from the vehicle image in recent years. Following a brief description for some of these techniques: Usha Rani [1] proposed a system for extraction of vehicle number plates using edge detection and morphological operations. He used the canny edge detection technique for finding the edges in the image. Satadal Saha and Subhadip Basu [2] proposed license plate localization from vehicle images: an edge based multistage approach system, they used the sobel edge detection for detection of edge gradients and they have developed a novel approach based on prominent vertical edges computed from vehicle images for localization of license plate regions. Peter Tarabek [3] proposed a real-time license plate localization method based on vertical edge analysis. Finally in this review, N. Boonsim and S. Prakoonwit [4] proposed license plate localization based on statistical measures of license plate features system. The proposed algorithm for (LPL) system consists of two main stages. The first stage is the extraction of candidates regions, while the second stage is the candidate verification.

III. THE ALGORITHM OF NUMBER PLATE EXTRACTION USING MORPHOLOGICAL OPERATIONS
This is the first method in this paper. Its algorithm is aim to finding and cutting the Region of Interest (ROI), which is assumed to contain the license plate by using morphological operations to extract the LP from the vehicle image that already entered to the system. The stages of the algorithm for this method are shown in Fig. 2 below.

Fig. 2: Morphological operations method stages
Here is the explanation of each block for the previous figure:

A. Read image
The first stage in this system is read the car image that is already captured by a digital camera; the image is either PNG or JPEG type. The cars images are variable in size, resolutions and color depending on the hardware used for acquisition. Some of images that entered to the system are shown in Fig. 3

B. Cutting and resizing the original image
Because the images entering the system are variable in size, so that we must resize the original image into a constant size like (480*640) pixels to reduce the high computational cost and time in processing, and cutting a present from the image to focus on the region of license plate. The result of this stage is shown in Fig. 4.

C. Converting image to gray-scale
This algorithm works on gray image, thus this stage convert Red Green Blue (RGB) image to gray scale intensity image then to binary in order to facilitate the plate extraction, and increase the processing speed. RGB images are composed of three independent channels for red, green and blue primary color components [5]. The example shown in Fig.5 shows the color channel splitting of a full RGB color image, the column at left shows the isolated color channels in natural colors, while at right there are their gray scale equivalences. The MATLAB instruction that used for this purpose is:

>> I = rgb2gray (RGB)
The result of using this instruction is shown in Fig.6. The instruction above use the formula below to convert the colored image into a gray image [5]:

D. Adjust intensities of gray image
Adjust intensities is an image enhancement, this stage increases the contrast of the output image. The MATLAB function that used for intensity adjusting is:

>> J = imadjust (I)
This function is the basic image processing toolbox function for intensity transformation of gray-scale images [6]. The resulting image from this stage is shown in Fig.7.

E. Top-hat transforms
Top-Hat transform is an operation that extracts small elements and details from a given image [6]. There are two types of tophat transform: white top-hat transform and black top-hat transform. The black top-hat transform is defined as the difference between the closing and the input image and this is the type that is used in this algorithm. The instructions were used to perform this stage are:

F. Removing small objects that not a plate
After the top-hat filtering there will be many small objects or points stayed in the image. This kind of noise will effect on the extracting of the LP from the image. We have set the maximum size of the object that will be removed to 70 pixels [7]. The result can be viewed in Fig.9.   Fig. 9: Removing Small Objects

G. Selecting the largest connected components
In this stage filling the areas in the image, then using labeling connected components [8] to calculate the number of connected objects (white areas), then select the largest area and delete the others. This selected area assumed to contain the number plate. Fig. 10 shows the result of all areas before the selecting operation.

USING SOBEL EDGE DETECTION
This is the second method that used to extract the LP from the car image. The algorithm used sobel edge detection to extract the LP from its edges in the image. The algorithm is explained in the flowchart shown in Fig. 12.

Fig. 12: Edge detection algorithm
The operation of each step in the algorithm will be explained here.

A. Read image
This step is the same step in the previous method for extraction. Fig. 13 shows the input image to the system.

B. Size reduction
Due to the evolution of digital cameras, the accuracy and dimensions of the image has become great. For this reason, size must be reduced to reduce the cost of calculations and time. The instruction that used to do this work is Image pyramid reduction and expansion, the reduction is used here in this system, impyramid function computes a Gaussian pyramid reduction or expansion of A by one level [9], If A is m-by-n and direction is 'reduce', then the size of B is ceil(M/2)-by-ceil(N/2):

C. RGB to gray conversion
This step is also the same as in the morphological operations method for extraction, the result of this step is shown in Fig. 14

D. Edge detection
Edges of the image are detected by sobel operator as shown in Fig. 15a. The sobel command performs a two dimensional spatial gradient measurement on an image. Sobel operator is used to find the approximate absolute gradient magnitude at each point in the gray-scale image [10]. After sobel edge detection, dilation operation is applied on the sobel edge detected image to make the image clearer and easier to extract the LP. The result of dilation is viewed in Fig. 15b.

E. Median filter
The basic aim of using the filter is to remove the noise and distortion from the image. Median filter is the type that used in the proposed method. The median filter is a non-linear filtering technique used to remove noise from the image under consideration. The job of median filter is not just removing noise but also it preserves the edges and smoothness the image by utilizing the median of neighborhood [11]. Fig. 16 is shown the result after applying median filter.

F. Morphological operations
Morphological operations that used here in this stage are (imfill, imerode and bwareaopen). Image filling This matlab function fills holes in the binary image. The instruction syntax is:

Erode operation
The instruction syntax is:

>> IM2 = imerode (IM, se);
This function erodes the gray-scale, binary or packed binary image. The argument se is a structuring element object of array of structuring element object returned by the strel function. Fig.  18 shows the result of eroding operation.

Fig. 18: erosion operation
Binary area opening The function syntax is:

>> BW2 = bwareaopen (BW, P);
This matlab function removes from a binary image all connected components (objects) that have fewer than P pixels, producing another binary image, BW2. The result of opening binary area is viewed in Fig. 19.

G. Cutting the LP from the gray-scale image
The final step in this algorithm is cutting the ROI that is containing the LP from the gray image. This is done by taking the size and dimensions of the remaining area in the previous figure and cutting the LP from the gray image depending on these dimensions. The result of this stage is viewed in Fig. 20.

V. EXPERIMENTAL RESULTS
The methods that described in sections III and IV are applied to localize the different three styles of Iraqi cars number plates. The methods are implemented in MATLAB R2014a. Total of 60 vehicle's images are tested. Images are taken in different illuminations conditions. The proposed methods work good for low contrast, noisy and bad resolution car images. The average run time for the first method (Morphological Operations Method) is 3s, while the average run time is 2s for the edge detection method using computer. The proposed methods for LP extraction are illustrate in Table 1 and the results of proposed approaches for number plate extraction are shown in Table 2.    Fig.21 were shows the LP that is correctly extracted by morphological operations method. The problem is in the sobel edge detection method here in this example as shown in Fig. 22.
In the morphological operations stage, the filling operation fills the wrong area, and the LP area not filled yields the wrong area extracted instead of the LP area.
Example 2: sample car that found by sobel edge detection and not found by morphological operations. Morphological operations method couldn't find the area of the LP, because there is much noise in the filling operation image even after removing it in the previous stages

Ⅵ. CONCLUSIONS AND FUTURE WORK
A vehicle number plate extraction system is proposed in this paper. The extraction is done by using two methods (Morphological operations and Edge detection). The proposed methods are mainly designed for real-time Iraqi vehicles number plates. Comparison is done between the two methods in results. These extraction processes work well for low resolution, noisy and low contrast images. The techniques are tested with 60 images samples. The extraction rate for morphological operations method is 98.33 % and 81.66 % for sobel edge detection method. We conclude from this paper that the morphological operations method is preferred for LP localization due to high extraction percentage compared to sobel edge detection method. For future work, recognition system for the extracted LPs will be designed by using Neural Network