Use of Mathematical Morphology in Vehicle Plate Detection

In the past couple of decades, the number of vehicles has increased radically. A statistic which presents the number of cars sold worldwide from 1990 through 2017, forecasts for 2018, some 81.6 million automobiles are expected to be sold by the end 2018. With this continuous increase, it is becoming very tedious to keep track of each vehicle for the purpose of security, law enforcement and traffic management. This phenomenon of rapidly increasing vehicles on the road highlights the importance for a vehicle number plate recognition system. By recognizing the car plates, the drivers of the vehicle can be identified from the database. Number plate detection system are used in various applications like traffic law maintenance, traffic control, automatic toll collection, parking systems, automatic gate openers. This paper presents a unique algorithmic procedure for detecting vehicle plate number which is based on the concept of mathematical morphology. The developed algorithm is simple, efficient and flexible. The algorithm is capable of working satisfactorily even in different constraints such as like rain, smoke and shadow. This user-friendly software tool is developed on MATLAB platform which is one of the common and efficient image processing analysis tools. Oriental Journal of Computer Science and Technology Journal Website: www.computerscijournal.org ISSN: 0974-6471, Vol. 11, No. (4) 2018, Pg. 195-200


Introduction
In recent years, research in developing an efficient vehicle number plate detection system has attracted a lot of attention. Every country has a unique number plate. Every number plate has a unique number which helps to distinguish one vehicle from another especially when the vehicles are of the same color, make and model. A vehicle number plate detection system can be designed to identify the number plate of the vehicle and extract the characters from the number plate. For further processing, the characters of the number plate can be used to recover information about the vehicle and its owner. In government sectors, for regulating authorities, vehicle number plate detection systems can be used in law enforcement, border protection, vehicle thefts, automatic toll collection along with the traffic monitoring and control. While in private sectors, vehicle number plate detection systems can be used to control the access or denial of entries in restricted complexes or campuses. Also, automatic parking control and guidance along with surveillance of the vehicle can be managed using vehicle number plate detection systems.
The rapid growth of a number of vehicles on road raises the importance of the development of a robust number plate recognition system for enforcing efficient laws and traffic rules for a steady traffic flow. A vehicle number plate detection system comprises of many processes such as image acquisition, localization of the number plate region, segmentation of the characters and character recognition. The first step in any vehicle number plate detection system is image acquisition. Image acquisition must be done with a high-resolution camera in order to get a clarion image. After acquiring the car image, the next important task is the localization of the license plate from the car image. To accomplish this task, it is essential that the license plate should exhibit sharp rectangular edges. The next step in vehicle number plate detection system is that the characters on the license plate must be segmented for character recognition. As the characters on the number plate are segmented, the task ahead remaining is to recognize the characters. 1,2 Every country has its unique vehicle identification systems for its transportation engineering. The size, color and format of the number plates vary for various vehicle types.

Background
Vehicle number plate detection can be done using many image processing techniques. One such technique is the mathematical morphology. Mathematical morphology is a powerful tool that is used to extract image components which help in representation and description of a particular shape or region of an image. It is used to investigate the interaction between an image and a certain chosen structuring element.
The vehicle number plate detection is a crucial process as the images of the number plates may undergo deteriorations like different weather conditions, size variations, tilt in the number plate position, and damages to the number plate. Humans can easily read the number plates under these circumstances, whereas, it is difficult for a machine. Therefore, efficient algorithms need to be developed to recognize the number plates of different series, the differently classified number plates, and the number plates subjected to different weather conditions and damages. The developed algorithms will make use of mathematical morphological transforms like dilation, erosion, closing, opening, etc. During the mathematical morphological transforms, the structuring elements for each of the developed algorithms are to be selected through a trial and error method using a statistical approach.
Many algorithms were developed for vehicle number plate detection systems. However, for this paper an algorithm using the combination of mathematical morphology for pre-processing and localization, bounding box technique for segmentation and template matching for character recognition was never developed. The MATLAB software tools are used for simulation, test and validation of the developed algorithms.

Mathematical Morphology
Mathematical morphology is a powerful tool that is used to extract image components which help in representation and description of a particular shape or region of an image. Mathematical morphology is developed using the set theory. In image processing, mathematical morphology is used to investigate the interaction between an image and a certain chosen Structuring Element (SE). The interaction can be the set operations like dilation and erosion. Dilation and erosion are the basic set operations and all other operations are derived from dilation and erosion. One of the most significant contributions of mathematical morphology is the morphological filters which are closing and opening set operations. 3,4 To perform any mathematical morphological operation, the input image should always be able to be represented as a set of points. Once an image is represented by a point set, then all the morphological operations on the images are set operations on those point sets. For binary images, the set represents the two-dimensional integer space Z^2, where both the components give the coordinate of the pixel. For gray-scale images, the sets represent the three-dimensional integer space Z^3, where two components give the coordinate of the pixel and the third component give the discrete intensity value of the pixel. 5 It is impossible to directly apply a morphological set operation on an image. A structuring element is needed which help to apply the desired set operation to the input image under study to obtain the properties of interest. A structuring element is a shape mask used in the basic morphological operations. The structuring elements are always smaller than the input image. It has an origin and a shape.
There are two types of Structuring elements, Flat structuring element and Non-flat structuring element. Flat structuring elements are used for 2-D images whereas non-flat structuring elements are used for 3-D images. The parameters of flat structuring elements are length and breadth whereas the parameters of non-flat structuring elements are length, breadth and height. Flat structuring elements include disk, circle, rectangle, square, line. Non-flat structuring elements include arbitrary and ball. [5][6][7] Application specific structuring elements created by the user. If the input image has sharp corners then square, diamond or line shape structuring elements are used. If the input image is arbitrary and smooth then, circular shape structuring elements are used. Depending on the input image and the properties of interest, the shape and size of the structuring element are decided. They can be of any shape and size that is digitally representable, and each has an origin. Some shapes of structuring elements are shown in Figure 1.

Basic Set Operations Used in Mathematical Morphology
Basic operations used in Mathematical Morphology for binary or valued images are based on logical or arithmetic calculations respectively. The operations are carried out on a local neighborhood of a pixel. The neighborhood is a subset of pixels defined by the shape of the structuring element, which has a corresponding origin, that determines the position of the calculated value in the output image.
The language of mathematical morphology is set theory. In context, if x = (x1, x2) is an element in X: x ∈ X, let rewrite some of the basic set theory operations to make better flow for the readers (see Table 1). Translation of a set A by a vector z = (z1, z2): AZ = {x|x = a + z, a ∈ A}

Logical Expressions to Perform Set Operations
The logical expressions to perform basic set operations are depicted in Table 2.

The Developed Algorithmic Procedure
The developed algorithmic procedure for detecting vehicle plate number which is based on the concept of Mathematical Morphology is presented as follows: 1.
Input the image 2.
Pre-processing of the image a. Resize image. b. Convert input image into grey scale image. c. Noise removal using morphological filters.

3.
Localization of number plate a. E x t ra c t i n g t h e nu m b e r p l a t e u s i n g morphological operations.

4.
Segmentation of characters a. Calculate number of connected components. b. Perform bounding box techniques to segment the connected components.

5.
Recognition of characters. a. Resize image. b. Initialize templates. Noise removal using morphological filters. c. Convert the size of the segmented characters to the size of templates saved in database. d. Find the correlation coefficient value of segmented character with each template image stored in the database and store that value in an array. e. Find out the maximum correlation coefficient value in the array. f. Find the letter which is similar to the maximum correlation value. g. Store that letter in an array. Repeat the steps for every segmented character. h. E x t ra c t i n g t h e nu m b e r p l a t e u s i n g morphological operations. 6.
Display the letters stored in the array as result in a notepad file.
The flowchart concept of Mathematical Morphology is depicted in Figure 2.

Methodology
This section discusses the different steps in the vehicle plate detection system. The algorithm used for this consists of the following steps: 1. Image Acquisition 2.
Pre-processing of the Input Image 3.
Localization of the Number Plate 4.
Segmentation of Characters 5.
Recognition of segmented characters 6.
Display of Results

Image Acquisition
The first step of the NPR system is the image acquisition. It is the process of obtaining or capturing  Fig. 2: The flowchart the image before the image will be processed for the next step. During image acquisition the type of camera used, the resolution of the camera, distance of the camera from the vehicle, illumination characteristics must be taken into account.

Pre-processing of the Input Image
Pre-processing consists of two steps: resizing of the image and removing noise using morphological filters. The input image must be resized keeping its aspect ratio same. For the image to fit the operational window, the image must be resized without changing the aspect ratio. The input image and the templates are converted into binary images and resized to the same size. Since we have many images, all the images must be resized to a particular size so that we have a common basis for each and every image.
In an input image, there can be various noises and small impurities that will affect the outcome of the output. These noises can be removed using morphological operations with specific structuring elements. The type of morphological operator and which structuring elements should be used is determined on the type of noise present in the image.

Localization of the Vehicle Plate
Localization of the number plate is performed to extract only the number plate from the image of the vehicle. Localization is done using morphological operations.

Segmentation of Characters
In segmentation of characters, the characters from the localized image are segmented. It is done by finding out the connected components. The connected components are found using the regionprops MATLAB command. Once the connected components are found, the bounding box command in MATLAB is used to draw rectangles around all the connected components found. This step provides us with the segmented characters. 8

Recognition of Characters
Recognition of characters is done using template matching. The templates are normalized to 42 x 24 pixels and stored in the database. The templates should fit into a window without white spaces on all the four sides. Once the characters are segmented, we begin the character recognition by 2D correlation.
We correlate each segmented character with either the alphabets or numeral templates from the database and then we choose the value of each character based on the result of correlation. The correlation is done in pixel by pixel basis. The result of character recognition is selected based on the maximum values of correlation for each character.
Only the connected components showing the maximum correlation values will be selected, the remaining boxes will be discarded. 9-12

Display of Results
The recognised and extracted characters are saved in text file format. The results are displayed in a Notepad window.

Conclusion
This paper discusses about the algorithm developed for a successfully working vehicle number plate detection technique. The steps of the algorithm are reviewed. A detailed study of mathematical morphology, morphological operations, structuring elements and design of SEs were done for this paper. Various algorithms and techniques used in previous vehicle number plate detection systems and for other countries were studied. Mathematical morphology was used in the pre-processing step and localization step. Template matching technique was used for character recognition. The format, background colour or the number of characters of the number plate does not matter in this algorithm. Only a few methods for adaptive morphological operators have been developed for the real-time applications. The reason might be due to relatively high computational complexity of computing adaptive structuring elements. Efficient algorithms for computing adaptive structuring elements need to be developed to exploit the extensive use of adaptive morphology. Our algorithmic design and approach is an addition to give the strength to the use of Morphology in image processing.