# A Quantitative Detection Method for Surface Cracks on Slab Track Based on Infrared Thermography
## 2 Infrared-Thermogram Processing
### Edge Detection of Infrared Thermogram  
The current edge-detection methods for infrared thermograms are mainly based on the gray gradient of the image or the measurement standards on the gray space, so the effect of detection depends heavily on the grayscale and contrast of the image. However, in the infrared thermogram of the track slab with surface cracks, the difference between the grayscale at the crack edge and intact part is small and difficult to detect. To solve this problem, this paper adopts a crack-edge-detection algorithm based on phase congruency of the Fourier components of the infrared image of the slab-surface cracks, and sets the phase congruency with large values in the image as the feature points of the crack edge. Through these steps, the crack area in tan infrared image can be detected. Since the phase congruency is not affected by the gray gradient at the crack edge in the infrared image, it has a higher detection accuracy than the edge-detection algorithm based on gray gradient and gray space. The Fourier expansion of one-dimensional signal \(t(z)\) can be obtained by Fourier transformation:  
\[t(z)=\sum_{d}A_{d}\cos(d\omega z+\varphi_{d0})=\sum_{d}A_{d}\cos(\varphi_{d}(z)) \tag{8}\]  
where \(A_{d}\), \(\varphi_{d0}\), \(\omega\) are the amplitude, initial phase, and angular frequency of the \(d\)-th Fourier component of the signal \(t(z)\), respectively. The \(\varphi_{d}(z)\) is the phase value of the \(d\)-th Fourier component at \(z\). According to the previous research on the phase characteristics of Fourier series of various signals [20], phase congruency can be defined as:  
\[PC(z)=\max_{\overline{\varphi}(z)\in[0,2\pi]}\frac{\sum_{d}\cos[\varphi_{d}(z) -\overline{\varphi}(z)]}{\sum_{d}A_{d}} \tag{9}\]  
where \(\overline{\varphi}(z)\) is the weighted average phase value of the Fourier components of the signal \(t(z)\) when \(PC(z)\) takes the maximum value at point \(z\). It can be seen from Equation (9) that in order to maximize the phase congruency \(PC(z)\), the sum of the differences between the phase \(\varphi_{d}(z)\) and \(\overline{\varphi}(z)\) of each Fourier component of signal \(t(z)\) must reach the minimum value. To solve problem of computation cost in Equation (9), [PERSON] et al. [21] introduced the concept of local energy. The relationship between local energy function, phase\(-\)congruency function, and Fourier components of the signal is shown in Figure 4.  
Figure 4: Relationship between local energy function, phase\(-\)congruency function, and Fourier components of signal [21]. It can be seen from Figure 4 that the local energy can be expressed as:  
\[E(z)=\sqrt{l^{2}(z)+H^{2}(z)} \tag{10}\]  
where \(H(z)\) is the Hilbert transform of \(t(z)\). It can also be seen from Figure 4 that the local energy \(E(z)\) is the sum of the projections of the Fourier components of the signal \(t(z)\) in the \(E(z)\) direction:  
\[E(z)=\sum_{d}A_{d}\cos(\varphi_{d}(z)-\overline{\varphi}(z)) \tag{11}\]  
The combination of Equations (9) and (11) yields:  
\[PC(z)=\frac{E(z)}{\sum_{d}A_{d}} \tag{12}\]  
Equation (12) shows that the phase congruency is the ratio between the local energy and the sum of the amplitudes of the Fourier components of the signal, and Equation (11) shows that the local energy is closely related to the phase of the Fourier components. It can be seen that the phase congruency is greater when the phase-angle values of the Fourier components of the signal are centrally distributed. The principle of crack-edge detection is based on the fact that the distribution of the phase-angle value of each Fourier component at the crack edge is relatively concentrated, which means the phase congruency in the cracks is higher than those in the non-crack areas. The process of edge-detection algorithm of track-slab-surface cracks is as follows:  
Step 1. Calculate the phase congruency of all pixels in the infrared thermogram of slab surface cracks. Step 2.