Region of Interest ROI Median Filter

28 A number of conditions like poor image contrast or spatial nonuniformities in background intensity can make difficult to resolve foreground and background. These cases require user interaction for specifying the desired object and its distinguishing intensity features.

2.1.1.3 Region of Interest ROI

The most critical step in applying machine learning is the identification of appropriate features known as Region of Interest ROI. The raw data in each image basically consists of two attributes for each pixel: intensity and location Wong and Bishop, 2006. This approach helps to make the data more amenable to machine learning how to draw the ROI based on human perception. Then the creation of ROI is to pick out the approximate region needed in the system by identifying the types of glue defects of the image. Once the approximate region is identified, the information needed must be separated with the model image and its background to ensure there is no other disturbances that might occur in the system. Figure 2.9: Threshold Results for Example Images using Threshold Value of 200 29 According to Figure 2.10 shows that the left figure is source images used as template model defect in training phase describe in Chapter 3. In order to ensure the system is fully optimized, the approximate location of the desired image needs to be extracted, and then used for correction. This helps the system to differentiate between model and its background in contrast for limiting the space and required time consuming. Right figure of Figure 2.10 shows the resulting image of ROI where the system ignored the background of image and extract only space created through ROI. This algorithm creates a system to be more reliable for extracting using high quality images.

2.1.1.4 Median Filter

Median filter is one of the commonly used non-linear filters that replace the value of pixel by the median of the gray-level values of the neighbours of that original value of the pixel. The median is calculated by first sorting all the pixel values from the surrounding neighbourhood into numerical order and then replacing the pixel being considered with middle pixel value. This is given by Zhang, 2009 Figure 2.10: Region of Interest Before and After Process 30 { } 2.3 Where N x, y is the neighbourhood area the filter mask centered at x, y. Figure 2.11 illustrates an example calculation. The median, m , of a set of values satisfies such that half of the values in the set are less than or equal to m , while the rest are greater than or equal to m in order to perform median filtering at a point in an image, the values of the pixel and its neighbors should be sorted. Their median is the determined and assigned to that pixel. Median filter are particularly effective in the presence of impulse noise. It has the advantage of removing noise while keeping the original edges in the image. It can provide excellent noise- reduction capabilities, with considerably less blurriness than the linear smoothing filters of similar size. By removing noise, the image looks sharper in terms of edges and corners that will help mostly on this research. The following example shows the application of a median filter to a simple one dimensional signal. A window size of three is used, with one entry immediately preceding and following each entry. Figure 2.11: Median Filter Application 31 For y [1] and y [10], extend the left most or right most value outside the boundaries of the image same as leaving left most or right most value unchanged after 1-D median. In Median filtering, the neighboring pixels are ranked according to the brightness intensity and the median value becomes the new value for the central pixels. It offers services in reject ing certain types of noise, in particular, “shot” or impulse noise in which some individuals pixels have extreme value. Median filters have its own specialties in terms of removing noise: 1. No reduction in contrast across steps, since output values available consists only of those present in the neighbourhood no averages. 2. It does not shift boundaries, as can happen with conventional smoothing filters a contrast dependent problem. 3. Since the median filter is less sensitive than the mean to extreme values outliers, those extreme values are more effectively removed. Figure 2.12: Median Filter Example Calculation for 1-Dimensional Data 32

2.1.1.5 Harris Corner Detection