# A Quantitative Detection Method for Surface Cracks on Slab Track Based on Infrared Thermography
## 2 Infrared-Thermogram Processing
### Non-Subsampled Contourlet Transform (NSCT)-Based Image-Enhancement Algorithm
To avoid the influence of the grayscale of the original image on the coefficients \(a\), \(b\), and \(c\) in the enhancement function, the maximum transformation coefficient \(x_{max}\) in the directional sub-band is used as the normalization factor to normalize the transformation coefficient. Figure 3: Principle of NSCT transform: (**a**) decomposition structure; (**b**) sub-bands on frequency plane. It can be seen from Equations (2)-(4) that the domain of \(f(x)\) is [-1, 1], and \(f(0)=0\), \(f(1)=1\). The coefficient \(b\) in Equation (2) is determined by solving the nonlinear equation \(f(x)=x\), and the enhancement function becomes:  
\[f(x)=ax_{max}\bigg{[}sign\bigg{(}c\bigg{(}\frac{x}{x_{max}}-b\bigg{)}\bigg{)}- sign\bigg{(}-c\bigg{(}\frac{x}{x_{max}}+b\bigg{)}\bigg{)}\bigg{]} \tag{5}\]  
The thresholds at different scales and in different directions are selected in Equation (1) by using the transformation coefficients. However, if these thresholds are directly used to modify the transformation coefficients at a certain scale or in a certain direction without considering the correlation of the transformation coefficients at different scales, some key transformation coefficients may be considered as noise and set to zero. To consider the correlation between transformation coefficients at different scales, a multiscale product is introduced into the infrared-image-enhancement algorithm in this paper, which is expressed as:  
\[P_{k}^{l}f(m,n)=W_{k}^{l}f(m,n)\cdot W_{k}^{l+1}f(m,n) \tag{6}\]  
where \(P_{k}^{l}f(m,n)\) is the multiscale product of the \(k\)-th directional sub-band on the \(l\)-th scale at coordinates \((m,n)\), \(W_{k}^{l}f(m,n)\) is the transformation coefficient of the \(k\)-th directional sub-band on the \(l\)-th scale at coordinates \((m,n)\), and \(W_{k}^{l+1}f(m,n)\) is the transformation coefficient of the \(k\)-th directional sub-band on the (\(l\)+1)th scale at coordinates \((m,n)\). It can be seen from Equation (6) that the multiscale product is the product of the transformation coefficients of the image in the same directional sub-bands of two adjacent scales. In this paper, the threshold is used to modify the multiscale product rather than the transformation coefficients to avoid the aforementioned problem. Thus, the infrared-image-enhancement algorithm can preserve more details of the original image while strengthening the crack edges and reducing the noise in the image. The process of the proposed image-enhancement algorithm based on multiscale product is as follows:  
Step 1. Use NSCT to decompose the original image to layer \(L\), and obtain the transformation coefficients in sub-bands of \(i\) scales and \(2^{i}\) directions. Step 2. Determine the threshold values for sub-bands of different scales and directions according to Equation (1), and obtain the adaptive enhancement function \(f(x)\) according to Equation (5). Step 3. Use Equation (6) to calculate the multiscale product \(P_{r}^{j}f(m,n)\) of sub-bands in each direction, where \(j\in[1,i-1],\ r\in\big{[}1,2^{i}\big{]}\). According to Equation (7), the threshold \(T_{r}^{j}\) is directly substituted for the multiscale product \(P_{r}^{j}f(m,n)\) to reduce the noise. \[\overline{W}_{r}^{j}f(m,n)= \begin{cases}W_{r}^{j}f(m,n),&\mid\ P_{r}^{j}f(m,n )\geq T_{r}^{j}\\ 0,&\mid\ P_{r}^{j}f(m,n)<T_{r}^{j}\end{cases}  \tag{7}\]  
where \(W_{r}^{j}f(m,n)\) is the transformation coefficient of the \(r\)-th directional sub-band on the \(j\)-th scale at coordinates \((m,n)\), \(P_{r}^{j}f(m,n)\) is the multiscale product of the \(i\)-th directional sub-band on the \(j\)-th scale at coordinates \((m,n)\), \(T_{r}^{j}\) is the threshold value of the \(r\)-th directional sub-band on the \(j\)-th scale, and \(\overline{W}_{r}^{j}f(m,n)\) is the new transformation coefficient at the coordinates \((m,n)\) of the \(r\)-th directional sub-band on the \(j\)-th scale obtained after thresholding. Step 4. Substitute \(\overline{W}_{k}^{l}f(m,n)\) into the enhancement function \(f(x)\) to conduct image enhancement. Step 5.