Edge detection of magnetic tile cracks based on wavelet①

2015-04-17 06:37LinLijun林丽君HeMinggeYinYing
High Technology Letters 2015年3期

Lin Lijun (林丽君), He Mingge, Yin Ying

(*School of Manufacturing Science and Engineering, Sichuan University, Chengdu 610065, P.R.China)(**Gas Production Engineering Research Institute, Petro China Southwest Oil & Gas Field Co., Guanghan 618300, P.R.China)



Edge detection of magnetic tile cracks based on wavelet①

Lin Lijun (林丽君)*, He Mingge**, Yin Ying②

(*School of Manufacturing Science and Engineering, Sichuan University, Chengdu 610065, P.R.China)(**Gas Production Engineering Research Institute, Petro China Southwest Oil & Gas Field Co., Guanghan 618300, P.R.China)

In order to extract the defect edge information on the magnetic tile surface with low contrast and textured background, an edge detection algorithm based on image weighted information entropy and wavelet modulus maxima is proposed. At first, a new Butterworth high pass filter (BHPF) with adaptive cutoff frequency is produced, because the clarity and complexity of the textured background are described by the weighted information entropy of the image gradient variance quantitatively, and the filter can change its parameters through matching the non-linear relationship between the information entropy and the cutoff frequency. And then, the best decomposition scale is obtained by the level determination function to prevent edge information from missing. At last, edge points are got by double threshold after obtaining the wavelet modulus maxima, and then the edge image is linked by the edge points to ensure the edge continuity and veracity. Experiment results indicate that the proposed algorithm outperforms the conventional Canny and Sobel algorithm, and the edge detection algorithm can also detect other defects, and lays the foundation for defecting auto- recognition.

edge detection, wavelet transform, textures processing, magnetic tile, information entropy

0 Introduction

Magnetic tile is an important part of the motor, and its surface defects must be removed which affects the motor safety performance directly. And most companies use the artificial vision to detect the defections due to the magnetic tile with gray color and low image contrast. At present, adopting machine vision to complete the defect detection is a hot research on the nondestructive testing, and the image edge information extraction is the key of image processing[1,2], thus many edge detection algorithms have been applied evolutionarily to all kinds of image edge features extraction[3-5]. Ref.[6] uses Sobel and Canny algorithm to locate the locked weld edge for avoiding outside interruptions. Ref.[7] employs the wavelet multi-scale analysis to extract the feature points on X-ray cephalometric, and gets the desired effect on the automatic location. Ref.[8] presents local modulus maxima and dynamic threshold to solve the wavelet edge detection’s shortage such as inaccurate location. Ref.[9] has employed an independent component analysis (ICA) and a particle swarm optimization (PSO) to detect the LCD panel defects, and the proposed algorithm is suitable for the defects with large size and low image contrast. The research on magnetic tile defects detection is quite few due to the magnetic tile characteristics.

In Ref.[10], it proposes a defect extraction method based on adaptive morphological filter. Defects are removed or weakened by the adaptive morphological filtering to get the image background, and then the surface defects are extracted after comparing the original image with the background image, but it can’t get the accurate classification when the gray variety in small defects is big. Ref.[11] presents a texture analysis method to detect the defects on the magnetic tile surface. In this way, the original image is divided into several equal sized squares decomposed by the fast discrete curvelet transform(FDCT) at different scales and orientations, and then the coefficients are calculated as the feature vector of the support vector machine(SVM) classifier. However, it can’t get the desired result when defects percentage is less than 1/64 in magnetic tile image. Ref.[12] presents the learning vector quantization (LVQ) neural network to classify the magnetic tile defects, but it doesn’t explain how to extract the defects edge information correctly.

A new edge detection algorithm of the magnetic tile crack is proposed in this paper. The BHPF filter’s cutoff frequency is changed adaptively by the image gradient variance weighted information entropy, so the background texture and noise are restrained adequately. To make good use of the feature of the wavelet multi-scale resolution, the original image is transformed by the translation invariance binary wavelet to calculate the wavelet modulus maxima, and then the level determination function (LDF) is adopted to decrease the interference from the wavelet level. At last, the edge points of crack are got by the double threshold, and then it can get the crack edge image by linking the edge points. The experimental results show that the proposed algorithm can decrease the influence from the background, and extract the crack edge accurately and effectively.

1 The image preprocessing

The crack is one of the most typical magnetic tile defects, some cracks are slight and mixed with the background, and are difficult to be identified. Due to the energy difference between the crack and background, the crack’s energy stays in high frequency area. The ideal high pass filter (IHPF) has ringing effect at the cut-off frequency, while the exponential high pass filter (EHPF) brings noise. The BHPF is proposed in this paper to process the original image, which can restrain the interference from random textures and smooth the curve more effectively while the cutoff frequency is increasing, so the cracks are enhanced[13].The n level BHPF filter is defined as

(1)

where the crack image isf(x, y), and its filtering is

g(x, y)=F-1{F[f(x, y)]·H(u, v)}

(2)

In Eq.(2), F is Fourier transform, and F-1is inverse transform of F, g(x, y) is the filtered crack image.

1.1 The texture estimation

Information entropy can describe the image’s information content efficiently, but it ignores the space information of gray distribution[14]. The weighted entropy not only expresses the image’s average information content, but also reflects how the high gray value affects the image information entropy. The crack has high gray value and contains the noise, and the gray value is one of the standards about the image’s complexity degree.

If the image has 256 gray levels, gray value s is the weighting factor, so the weighted information entropy is

(if ps=0, pslogps=0)

(3)

In Eq.(3), S is the set of pixel values, psis the probability of the gray value s appearing in S.

In order to describe the texture complexity more objectively, and the gradient variance can reflect the changes of the texture detail, the weighted information entropy adjusted by the gradient variance can describe the texture details clarity qualitatively. Image gradient variance is

(4)

gradAVR=

(5)

So the image gradient variance weighted information entropy (IGVWIE) can be expressed as

(6)

(7)

The gradient variance is a reflection of the degree that the pixel gray value deviates from its average gray value, as the variance is bigger, the difference among the pixels is bigger, and the details of the image are more.

1.2 The texture description

In order to explain the reliability of the IGVWIE describing the different image background, the following is the analysis about this method.

H(S)=

(8)

(9)

Eq.(9) indicates that the whole intensity feature can reflect the background complexity at the same gray level.

1.3 The adjusting cutoff frequency correction

As a result, the system chart of the adjusting BHPF cutoff frequency is in Fig.1. According to the prior knowledge, the cutoff frequency of some typical magnetic tile crack which has different complexity are got, and then stored in the system. The weighted information entropy and the cutoff frequency is fitted by the segment linear interpolation while the system is running, and the relationship of the nonlinear function between them is determined. So it can get the cutoff frequency corresponding to the information entropy values of the different crack background, and the parameters of the BHPF is changed adaptively to realize the quantitative analysis of the energy change for the crack image.

Fig.1 The system chart of adjusting BHPF cutoff frequency

2 The edge detection principle

Binary wavelet edge detection is that the waiting detection signal is transformed by the second differential smooth function, and the image edge points are got through the wavelet modulus maximum[15].

Assume that the wavelet function ψ(t) and the signal f(t) is real function, and ψ(t) is the first derivation of smooth function θ(t), that ψ(t)=dθ(t)/dt, the f(t) binary wavelet transform is defined as follows

(10)

2.1 The wavelet modulus maxima

For a binary wavelet transform sequence Wf(2j,0), Wf(2j,1), …, Wf(2j,n), if it satisfies the following conditions.

(11)

Also Eq.(11) can’t take equal at the same time, so the wavelet coefficients can get the modulus maxima at the point m(0≤m≤n).

2.2 The optimal decomposition scale

Because the crack edge information is influenced by the wavelet decomposition scale greatly, so it needs an optimal decomposition scale got through the level determination function (LDF)[17]. The function is

(12)

2.3 The threshold determination

The threshold is the criterion of detecting the image edge, and affects the quality of the edge detection directly. Seeking the wavelet modulus’ maximum and minimum, and their average is the initial threshold T0.The window n×n scans image D, then it can get the wavelet coefficient Wj,k, so the threshold is

(13)

In Eq.(13), δ is the impact factor, and δ=0.5.

3 The magnetic tile crack edge detection

If crack D has N×N pixels, D={dn,m|n,m=0,1,…,N-1}, so the process of crack D multi-scale edge detection is as following:

(1) Image D is filtered by the new BHPF, then it can get image D1.

(2) Image D1is transformed by 2-D wavelet at 2j, W1f(2j, n, m), W2f(2j, n, m), n, m=0,1,…,N-1,1≤j≤J=log2N。

(3) Modulus Mf(2j, n, m) and the tangent value tanAf(2j, n, m) are got at pixel point (n,m).

(4) The optimal decomposition scale of image D1is determined by Eq.(12), and its flowchart is shown as Fig.2.

Fig.2 The flowchart of getting the optimal decomposition scale

(5) Threshold T got by Eq.(13) divides image D1into two parts. Modulus less than T are region R1, and the others are region R2. Also threshold T1in region R1and threshold T2in region R2can be got by Eq.(13), if T1

(6) The boundary points at one scale are got. If one pixel’s gray value in image D1is less than threshold T1, the gray value is 0, then image D1is changed into image I1, at the same way, it can get image I2at threshold T2. The image I2is the base, the image I1is the supplement for image I2, and t The flowchart of finding the contour line is shown as Fig.3.

Fig.3 The flowchart of seeking the boundary points

(7) Connect all edge points at scale 2j, it can get the modulus maxima line.

(8) The gray value of edge points meeting the algorithm is set as 255, and the others are set as 0, then the edge image I is got.

4 The analysis of experimental results

4.1 The analysis of filter result

Fig.4 is the axial crack of magnetic tile, and Fig.5 is the crack filtered by BHPF. Fig.5 shows that the defect is enhanced, and the random texture and noise of background is reduced effectively.

Fig.4 The axial crack

Fig.5 The axial crack filtered by BHPF

4.2 The analysis of edge detection results

The magnetic tile image from the production line is analyzed by the proposed method, and the image size is 256×128, the used PC is powered by a 3.2GHz Intel Core i5 Quad processor. This experiment is realized by the Matlab R2013a encoding.

The algorithm proposed in this paper is applied to the edge extraction of three crack defects, and the result is shown in Fig.6. From Fig.6(a), cracks can be seen on the end face and outside surface of magnetic tile obviously. The detection results of the Sobel operator in Fig.6(b) shows the crack defects can’t be extracted correctly, because the crack defects is multi-directional while the classical Sobel operator using only the horizontal direction and vertical direction template. It must add a new template to increase the direction detection information. Moreover, the false edges are smoothed by the Sobel operator, and the real edges are lost as well. On the other hand, because of lacking of the adaptability for different images, the threshold of the classical Sobel operator is determined by one’s experience. The results tested by Canny operator are shown in Fig.6(c), which shows the crack edges are interfered by the texture, and the real crack can’t be extracted correctly. That is because the traditional Canny operator calculates the gradient amplitude by using a finite difference average, which is sensitive to the noise and is easy to cause the real edge details lost or the false edge detected. The low contrast of magnetic tile makes the double threshold Canny algorithm based on gradient amplitude difficult to suppress the noise while preserving the edge in low-intensity, so that the effects of edge detection are affected. Tested results using the proposed algorithm are shown in Fig.6(d), in which the cracks are detected accurately, and the tested results are better than Sobel algorithm and Canny algorithm and achieve the desired effect.

Fig.6 Comparison of the proposed algorithm with other algorithm

There are 160 pieces of the magnetic tile, and the accepted products are 78, while the others have crack defects. The ones detected from the accepted magnetic tile is 72, so the false positive rate is (78-72)/78×100%=7.7%, and it indicates that there are 6 pieces of magnetic tile judged falsely because of the influence from the watermark or the dust on the magnetic tile surface. It can detect 77 pieces of the magnetic tile from the defects, and the missing rate is (82-77)/82×100%=6.1%, the reason of missing is that the direction of some cracks is consistent with the direction of grinding.

5 Conclusion

Using the image gradient variance to modify the weighted information entropy has made estimating the complexity of the magnetic tile crack defects background more accurately. The BHPF filter performance has been improved adaptively, and the background texture has been eliminated effectively. This paper uses the modulus maxima algorithm based on the wavelet transform to extract the crack edges, and the crack edge information is optimally retained because of the application of the optimal decomposition scale, and the double threshold has made finding the crack edges points more precisely. The experiment proves that the proposed algorithm of the edge detection is better than the classical edge detection algorithm, so it has laid the foundation for other magnetic tile defects detections.

[ 1] Lin K Y, Si H P, Zhou Q, et al. Plant leaf edge detection based on fuzzy logic. Transactions of the Chinese Society for Agricultural Machinery, 2013, 44(6):227-231

[ 2] Xiang R, Ying Y B, Jiang H Y, et al. Recognition of overlapping tomatoes based on edge curvature analysis. Transactions of the Chinese Society for Agricultural Machinery, 2012, 43(3):157-162 (In Chinese)

[ 3] Selvathi D, Dharani J. Realization of beamlet transform edge detection algorithm using FPGA. In: Proceedings of the 2013 International Conference on Signal Processing, Image Processing and Pattern Recognition, Coimbatore, India, 2013. 131-135

[ 4] Hussain P S J, Ayesha S. Analysis of edge detection algorithm for feature extraction in satellite images. In: Proceedings of the 2013 3rd IEEE International Conference on Space Science and Communication, IconSpace2013, Melaka, Malaysia, 2013. 238-242

[ 5] Zhao X F, Yin G F, Yin X Y, et al. Image edge detection based on support vector machine and cellular automata. Journal of Sichuan University (Engineering Science Edition), 2011, 43(1):137-142

[ 6] Kong M, Chen S B, Lin T. Weld seam edge detection based on composite edge detectors. Journal of Shanghai Jiaotong University, 2009, 43(5):693-696 (In Chinese)

[ 7] Ling X F, Yang J, Lu Y. Characteristic points extraction of X-Ray skull image based on wavelet multiscale analysis. Journal of Shanghai Jiaotong University, 2001, 35(9):1350-1354 (In Chinese)

[ 8] Fan Y J, Wu X H, Luo D S. A modified image edge detection algorithm based on wavelet transform. Journal of Sichuan University (Natural Science Edition), 2012, 49(6):1264-1268 (In Chinese)

[ 9] Tsneg Y H, Tsai D M. Defect detection of uneven brightness in low-contrast images using basis image representation. Pattern Recognition, 2010, 43(3):1129-1141

[10] Yu Y W, Yin G F, Jiang H H, et al. Defect extraction method of arc magnet surface image based on adaptive morphological filtering. Journal of Computer-Aided Design & Computer Graphics, 2012, 24(3):351-356 (In Chinese)

[11] Jiang H H, Yin G F, Liu P Y, et al. Defect detection on magnetic tile surface based on fast discrete curvelet transform and support vector machine. Journal of Sichuan University (Engineering Science Edition), 2012, 44(3):147-152 (In Chinese)

[12] Yan J L, Zheng X X, Li T Y. Application of LVQ neural network in classification of surface defects for arc segments ceramic magnet. Computer & Digital Engineering, 2009, 37(12):147-150 (In Chinese)

[13] Rafael C G, Richard E W. Digital Image Processing. Third Edition. Beijing: Publishing House of Electronics Industry, 2011. 305-308

[14] Li X Z, Yu H D, Yu Z J, et al. Optimal inspection method for surface defects of micro-components. Acta Armamentarii, 2011, 32(7):872-877 (In Chinese)

[15] Sun Y K. Wavelet and Image Processing Technology. Beijing: Tsinghua University Press, 2012. 185-186 (In Chinese)

[16] Maria P, Josef K. Optimal edge detectors for ramp edges. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1991, 13(5):483-491

[17] Zhang X, Wang H L. Stationary lifting wavelet de-noising method based on optimal decomposition level. High Voltage Engineering, 2009, 35(3):501-508 (In Chinese)

Lin Lijun, born in 1985. She is a Ph.D candidate of Sichuan University. She received her B.E. and M.E. degrees from Southwest Petroleum University in 2008 and 2011. Her research focuses on intelligent control and image processing.

10.3772/j.issn.1006-6748.2015.03.005

①Supported by the National Natural Science Foundation of China (No. 51205265).

②To whom correspondence should be addressed. E-mail: kevin_yying@hotmail.com Received on Mar. 19, 2014*, Yin Xiangyun*, Yin Guofu*