*3.3.2 Capture of image*

In this step, the image is captured by electronic devices such as infrared digital camera or any other camera suitable for night time. The image captured is stored in JPEG format. After that the captured image is converted into gray scale image.

#### *3.3.3 Pre-processing*

The next step after capturing the image is the pre-processing of the image. When the image is captured a lot of noises present in the image. Reducing the noises from the image are required to obtain an accurate result.

% Sobel Masking for filtering image S = imfilter (I, Mx,'replicate');

*Economic Applications for LED Lights in Industrial Sectors*

• Vertical and Horizontal Dilation

*DOI: http://dx.doi.org/10.5772/intechopen.95412*

Dy = strel('rectangle', [80,4]);

Dx = strel('rectangle', [4,80]);

Dy = strel('rectangle', [4, 29]);

The process of erosion reduces removing unwanted details from a binary

By filtering, the unwanted substances or noise can be removed or filtered out that is not a character or digits. Small objects or connected components should be removed and then the frame line that is connected to the digits should be

Stats = regionprops (L, properties) is applied for measuring a set of properties

The validation of the of the number-plate recognition program, and hence the

In this first test it needs to insure that the program recognizes any object, that is captured by the camera, has number plat. Therefore, the test is carried out to detect the number plat for different vehicle models and types with different orientations. The test result is illustrated in **Figure 6**. The program succeeded to detect the number-plate as rectangular frame include characters. It is worth to highlight here

that it is not part of the program function to "read" the number-plate.

Bwareaopen (Image Processing Toolbox) is applied for removing all the connected components from the binary image that have value less than P

image2 = bwareaopen(image, min(numberofpixel, 100));

for each labeled region in the label matrix L.

stats = regionprops (image2,'all');

detection of vehicle, is done by two tests.

% Vertical Dilation

Iy = imdilate (M,Dy); Iy = imfill(Iy,'holes'); % Horizontal Dilation

Ix = imdilate(M,Dx); Ix = imfill(Ix,'holes');

ID = imdilate(JP,Dy); ID = imfill(ID,'holes');

E = strel('line',50,0); IE = imerode(ID,E);

identified and separated.

• Detect plate from image

*3.3.6 Program validation process*

*3.3.6.1 Number-plate recognized*

• Filtering of digits

% Joint Places JP = Ix.\*Iy;

• Erosion

image. % Erosion

pixels.

**37**

The RGB image is then converted into a gray scale image for easy analysis as it consists of only two color channels.

The aim of this pre-processing is to improve the quality of the image. Image enhancement techniques are used in this step. Image enhancement techniques consists process of sharpening the edges of image, contrast manipulation, reducing noise, color image processing and image segmentation.

#### *3.3.4 Plate region extraction*

The most important stage is the extraction of number-plate from eroded image significantly. The extraction of number-plate can be done by using image segmentation method. Mathematical morphology is used to detect the region of interest and Sobel operator are used to calculate the threshold value.

In general, any vehicle has its own number-plate which is always in rectangular shape consists characters. Accordingly, the basic approach in the detection of a vehicle is to recognize its number-plate which is mainly frame with characters (Numbers and letters). So, it is necessary to detect two criteria: the edges of the rectangular plate and there are characters within the rectangular.

A morphology based approach for detection number-plates is used. Our proposed method applies basic mathematical morphology operations like dilation and erosion.

The software model using the image processing technology is designed. The programs are implemented in MATLAB. The algorithm is divided into following parts: capture image, pre-processing, plate region extraction, characters recognition.

#### *3.3.5 MATLAB code for number-plate recognition*

The following MATLAB code is written to implement the above mentioned parts:


*Economic Applications for LED Lights in Industrial Sectors DOI: http://dx.doi.org/10.5772/intechopen.95412*

> % Sobel Masking for filtering image S = imfilter (I, Mx,'replicate');


The process of erosion reduces removing unwanted details from a binary image.

% Erosion E = strel('line',50,0); IE = imerode(ID,E);

• Filtering of digits

By filtering, the unwanted substances or noise can be removed or filtered out that is not a character or digits. Small objects or connected components should be removed and then the frame line that is connected to the digits should be identified and separated.

Bwareaopen (Image Processing Toolbox) is applied for removing all the connected components from the binary image that have value less than P pixels.

image2 = bwareaopen(image, min(numberofpixel, 100));

Stats = regionprops (L, properties) is applied for measuring a set of properties for each labeled region in the label matrix L. stats = regionprops (image2,'all');

• Detect plate from image

### *3.3.6 Program validation process*

The validation of the of the number-plate recognition program, and hence the detection of vehicle, is done by two tests.
