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.