• No results found

Chapter 3: Application of defect detection algorithm

3.2 Data set

3.3.1 Enhancement of defect region

Image analysts emphasise the importance smoothing images for removal of unwanted peaks in intensity values prior to enhancement. However, the suitability of a particular enhancement technique is subject to the overall objectives of the application in consideration. To this end, in this thesis all images are smoothened by a median filter. Results from coins.png test image are presented in Figure 3.5. The Figure confirms Zhiyuan, Q., et al (2002) report that such statistical filters are efficient for noise reduction with improved preservation of useful detail in the original image.

Figure 3. 2: Depicts the Lab-2 original image and pre-smoothing pixel intensity value distribution

Figure 3. 3: Depicts the Lab-2 median filtered image and post smoothing pixel intensity value distribution

The median filter is preferred because each seed pixel is replaced by the median value of intensities around the seed as opposed to the averaging, or other statistical functions such as minimum or maximum value. After successful smoothing of the input image, four local enhancement techniques are comparatively studied and analysed using (data sets 1 and 2) and their respective performance is quantified by a measure of peak signal to noise ratio (PSNR). The mathematical models governing the different enhancement methods adopted in this thesis are described below.

3.3.1.1 Linear moving average filter (LMF)

In this method the averaging of a specified number of pixels (𝑁) around a seed value (π‘₯, 𝑦) is performed along each strip (i.e. along rolling direction) of the image. And depending on the information regarding noise type and distribution of intensity values within the original image, a compensation mean offset (Ξ”) is introduced to exclude uneven grey values contamination.

Weng, W. & Chen, H. (2015)presented the models in equations 3.1-3.4 and considered the influence of white noise thus assumed Ξ”=0.5, also suggesting the lower the value of Ξ” the more efficient noise reduction attained.

Where Ξ” value should be slightly greater than the standard deviation of 𝑁 pixels around seed pixel. 𝐼π‘₯𝑦 is original image. N is neighbourhood of pixels along the rolling direction.

Further consideration of environmental factors that challenge image processing of rail defects such as rust strips (usually distributed on both sides of the rail edges), are curtailed by means of image subtraction between πΌβˆ† (compensated image) and 𝐼π‘₯𝑦 (original image) as a remedy for such unwanted intensity levels.

πΌπ‘π‘œπ‘›= πΌβˆ†βˆ’ 𝐼π‘₯𝑦 (3.3)

πΌπ‘π‘œπ‘› could be positive, zero, or negative values which corresponds to defect free regions, background regions, and possible defect region respectively. And according to equation 3.4 the final enhanced image (πΌπ‘’π‘›β„Ž) is obtained as map of the LMAF grey value to a range of 0-L as opposed to 0 βˆ’ πΌπ‘π‘œπ‘›.

πΌπ‘’π‘›β„Ž= 𝐿 βˆ’ (𝐿𝑀𝐴𝐹π‘₯𝑦×𝐿

πΌπ‘π‘œπ‘› ) (3.4)

Figure 3. 4: Shows the result of Linear Moving Average Filtering (LMAF) of the original Lab-2 image.

3.3.1.2 Visibility Measure (VM) enhancement

Based on Michelson’s definition of contrast of an image, Vijaykumar, V.R., & Sangamithirai, S. (2015)proposed VM contrast enhancement technique defined in a similar manner to the working principle of the human eye (in terms of visualising objects). Furthermore, the method

utilises the maximum and minimum luminance of an input image (𝐼(π‘₯,𝑦)) within a local window.

In addition to the mean intensity (Β΅) the local visibility of the neighbourhood is derived as presented in equation 3.5. To ensure uniform background in the output image from this method, the pixel location with grey intensity value higher than the mean intensity of its corresponding local window is truncated according to equation 3.6.

𝑉(π‘₯, 𝑦) =𝐼(π‘₯,𝑦)βˆ’πœ‡

𝐼(π‘₯,𝑦)+πœ‡ (3.5)

π‘‰π‘’π‘›β„Ž = {

𝐼(π‘₯,𝑦)βˆ’πœ‡

𝐼(π‘₯,𝑦)+πœ‡ 𝑖𝑓 𝐼(π‘₯, 𝑦) < πœ‡ 0 π‘œπ‘‘β„Žπ‘’π‘Ÿπ‘€π‘–π‘ π‘’

(3.6)

Where πœ‡ is the mean intensity of the local window in consideration

Figure 3. 5: Shows the simulated result for Visibility measure enhancement for Lab-2 image.

3.3.1.3 Local normalisation (LN) enhancement

Normalisation is used to force the input image to more familiar or easier to process form. This method is well received for poor contrast images and illumination sensitive applications. The concept of linear local normalisation method (see equation 3.7) focuses on minimum and maximum pixel intensity values.

𝐼𝐿𝑁= (𝐼 βˆ’ πΌπ‘šπ‘–π‘›)π‘›π‘’π‘€πΌπ‘šπ‘Žπ‘₯βˆ’π‘›π‘’π‘€πΌπ‘šπ‘–π‘›

πΌπ‘šπ‘Žπ‘₯βˆ’πΌπ‘šπ‘–π‘› + π‘›π‘’π‘€πΌπ‘šπ‘–π‘› (3.7)

Where 𝐼𝐿𝑁 is the locally normalized image. πΌπ‘šπ‘–π‘› is the local minimum intensity value. π‘›π‘’π‘€πΌπ‘šπ‘–π‘› is the new minimum local intensity value. π‘›π‘’π‘€πΌπ‘šπ‘Žπ‘₯is the new maximum local intensity value.

Xie, X., & Lam, K. (2006)took into consideration mean and standard deviation intensities as opposed to the range utilized in equation 3.7. The objective of this modification as per equation 3.8-3.9 is to locally establish the contribution of each pixel to a function of required mean (RM) and required variance (RV). This offers the solution of illumination and reflectance inequality across the rail head especially in field acquired samples.

𝐿𝑁(π‘₯, 𝑦) = π‘…π‘š+ [βˆšπ‘…π‘£Γ— Οƒ(x, y)] (3.8)

Οƒ(x, y) = im(x,y)βˆ’im(x,y)Μ…Μ…Μ…Μ…Μ…Μ…Μ…Μ…Μ…Μ…

βˆšβˆ‘|im(x,y)βˆ’im(x,y)Μ…Μ…Μ…Μ…Μ…Μ…Μ…Μ…Μ…Μ…Μ…|

n(x,y)

(3.9)

Where π‘–π‘š(π‘₯, 𝑦) is the windowed sample of the original image. im(x, y)Μ…Μ…Μ…Μ…Μ…Μ…Μ…Μ…Μ…Μ… is the mean intensity of the window, Οƒ(x, y) is the standard deviation, and 𝑛(π‘₯, 𝑦) is the total number of data points.

Figure 3. 6: Shows the result for local normalisation performed on Lab-2 image.

3.3.1.4 Fast Fourier Transform (FFT) enhancement

High frequency components of acquired images are most contaminated by noise even though containing most detail, while the low frequency component contains the most information within an image. Based on this understanding the detection of damage from rail images requires careful extraction of both high and low frequencies. Fingerprint detection and recognition algorithms have demonstrated the use of Fast Fourier Transform (FFT) for enhancement by exclusion of unwanted frequencies. In this method the original image is divided into overlapping local windows and the dominant frequency of each window is enhanced according to equation 3.10 below.

𝑔(π‘₯, 𝑦) = πΉβˆ’1[𝐹(𝑒, 𝑣) Γ— |𝐹(𝑒, 𝑣)|π‘˜] (3.10) Where 𝑔(π‘₯, 𝑦) is the FFT enhanced image.

For gray images the range of π‘˜ values typically 0 < π‘˜ < 1 ensures adequate preservation of information by amplifying low frequencies while attenuating noise levels in high frequency component of the original image, where 𝐹(𝑒, 𝑣) is the Fourier transform of an image

𝑓(π‘₯, 𝑦) according to the Discrete Fourier Transform (DFT) relation in equation 3.11. Ishmael, S.M., (2011)further explains that better enhancement results are obtained if the magnitude of the FFT is squared or cubed before it is scaled by its magnitude raised to the power of π‘˜.

𝐹(𝑒, 𝑣) = βˆ‘π‘€βˆ’1π‘₯=0 βˆ‘π‘βˆ’1𝑦=0𝑓(π‘₯, 𝑦)exp (βˆ’2πœ‹(𝑀π‘₯𝑒 +𝑁𝑦𝑣)) (3.11) For pixel locations u and x =1,2,3…, M-1 while v and y =1,2,3…,N-1.

And the inverse DFT function is also evaluated accordingly:

𝑓(π‘₯, 𝑦) =𝑀𝑁1 βˆ‘π‘€βˆ’1𝑒=0βˆ‘π‘βˆ’1𝑣=0𝐹(𝑒, 𝑣)exp (βˆ’2πœ‹(𝑀𝑒π‘₯ +𝑁𝑣𝑦)) (3.12) For pixel locations u and x =1,2,3…, M-1 while v and y =1,2,3…,N-1.

In Figure 3.7 below, the performance of FFT on Lab-2 image is presented, with a block size of 3 Γ— 3, for the median filter and a maximum of 22 Γ— 22 block size for the FFT function detailed in Appendix C3.

Figure 3. 7: Shows the result of Fast Fourier transform on Lab-2 image.

Related documents