Green Design
III. SYSTEM ANALYSIS AND DESIGN
After dilation using the two matrices, segmentation is carried out by tracking the vertical and horizontal boundaries of the binary image [8]. So that the pixels can be grouped into regions that represent an object.
5) Normalization
Normalization aims to adjust the input image data with image data in the database [9]. This process is done by resizing the image size and adjusting the thickness of the letters using the Thinning process. So the final result of the normalization process is a normal image that has the same size as the image in the training and has a thickness of 1-2 pixels.
a) Thinning
Thinning is a process for making lines in an image into simpler shapes [10]. The purpose of this process is to reduce redundant pixels so as to produce the information needed by the system. One thinning algorithm is to use the Hilditch's Algorithm method. The algorithm works by using the 3x3 window as in Table 1.
TABLE 1. 3x3 window representation
P9 P2 P3
P8 P1 P4
P7 P6 P5
Hilditch's algorithm will convert p1 if it meets the following four conditions [11] :
• 2 < = B(p1) < = 6
• A(p1)=1
• p2.p4.p8=0 or A(p2) ≠ 1
• p2.p4.p6=0 or A(p4) ≠ 1 Where :
• B (p1) is the number of neighbors with a pixel value of 1 from p1.
• A (p1) is the number of transition pixels from 0 to 1 in the order p2, p3, p4, p5, p6, p7, p8, p9, p2.
D. Template Matching Correlation
Template matching Correlation is a statistical technique used to look for two or more quantitative variables / matrices [12]. For recognition to occur, the input characters are compared with each template to find the right match, or the template with the closest representation of the input character [2]. The level of match is represented as a correlation value which is the output of the Template Matching Correlation method. Correlation values are obtained using equation (4):
(4) Where :
r: is the correlation value between two matrices (range of values -1 and +1)
: is the pixel value to k in the matrix i
: is the pixel value to k in the matrix j
: is the average value of the matrix pixel i
: is the average value of the matrix pixel j
n : is the number of pixels in a matrix
Fig 4. Global system Flowchart 1) Image Acquisition Process
The image acquisition process is carried out by the user as represented in Figure 5. these stages are divided into 3 stages, namely :
The stage the user enters a file in the form of a digital image into the system. Image files that can be entered by the user can be in the form of image files such as .png, .jpg, .jpeg.
Next the system will take a digital image information in the form of a matrix of pixel values in the image.
existing matrix in the image.
The final result of the image acquisition stage is an image that has recognized the pixel matrix value so that it can proceed to the next process which will be explained in the next section.
Fig 5. Image Acquisition Flowchart 2) Image Preprocessing & Image Segmentation
Image preprocessing is done by input in the form of an acquisition image that has been recognized by the pixel matrix value in the previous stage. Figure 6 explains how the flow in the Preprocessing stage works. The stages of image preprocessing are divided into 3 sub-processes, namely:
Grayscaling: This stage is the initial process in the process of image preprocessing. At this stage the input image is converted to a grayscale image so that the image has an intensity of gray pixel values (0 -255)
Low Pass Filtering: At this stage the grayscaling image is convoluted using the Low Pass Filter kernel to produce smoother images.
Otsu Thresholding: At this stage the image of the Low Pass Filtering results is divided into two classes namely black & white (0 & 255). This stage is needed to separate the part that is the object (Greek letters) and background. Threshold value (T) used at this stage is obtained by calculating the intensity value in the histogram in equation (2).
The results of preprocessing then become input images for the next process, namely segmentation. Segmentation is done to separate each sentence / word and each letter in the image.
Fig 6. Image preprocessing flowchart 3) Normalization
The flow of the normalization process is shown in Figure 7. The normalization phase consists of 2 sub- processes, namely:
Resizing: This stage is done by changing the size of the test image in accordance with that of the training data that is 15x15 pixels.
Thinning: this process aims to reduce the thickness of the pixels in the letters so as to produce only the information needed by the system. The thinning process works by changing the middle pixels of the image in the 3x3 window using the Hilditch's algorithm, until the entire pixel is in the image matrix so that it produces a letter thickness <= 2 pixels.
4) Template Matching Correlation
The next stage is the classification stage using the Template Matching Correlation method. Figure 8 explains how the flow of the Template Matching Correlation stage. at this stage the first normal image (K) up to the number of segmented and normalized images (N) is calculated to be correlated with each training image contained in the directory file by using equation (4). The best correlation
value is the largest correlation value which is the closest to 1. After the best correlation value is obtained, the system will convert the image into the label owned by the training data. The process will continue to be repeated by the system until it matches the number of letters / objects that have been segmented by the system.
Fig 7. Image normalization flowchart
Fig 8. Template Matching Correlation flowchart