# The Identification and Assessment of Rail Corrugation Based on Computer Vision
## 4 Estimation of Rail Corrugation Period
### Corrugation Period Estimation Based on FFT-NDMF  
After the corrugation interval is localized, Fourier transformation analysis is performed on each column of the corrugation interval image. Subsequently, the simplified NDMF is used to obtain the period of each column. Finally, the results of the entire interval are statistically analyzed to determine the period of the corrugation. The diagram of FFT-NDMF is shown as in Figure 9.  
Specifically, let \(L\) be a set of \(H\)-dimensional image columns obtained from the corrugation interval, that is, \(L=[l_{1},l_{2},...,l_{N}]\in\Re^{H\times N}\) where \(l_{i}\) represents a column of the corrugation interval image at position \(i\), \(H\) denotes the height of the corrugation interval image and \(N\) is the width of the corrugation interval. Firstly, one-dimensional fast Fourier transformation is conducted to each column of interval image, that is  
\[f_{m}=\sum_{k=0}^{H-1}l_{ik}e^{\frac{-l2\pi mk}{H}},1\leq i\leq N \tag{20}\]  
where \(l_{ik}\) denotes the gray value of the image column \(l_{i}\) at position \(k\). \(f_{m}\) for \(0\leq m\leq H-1\) represents the Fourier coefficients with frequency \(m\). As a result, an amplitude-frequency curve for each column is obtained. In this section, to better introduce subsequent steps, the amplitude-frequency curve of some interval image columns randomly selected in corrugation interval is shown as in Figure 10.  
Figure 9: The structure diagram of fast Fourier transform normalized distance matching function (FFT-NDMF). Each curve has an amplitude peak at the same frequency, as observed in Figure 10. In most cases, the peak is the maximum but in a few cases, the peak is the second maximum due to the interference of the sub-period or the multiple of the main period. Therefore, when locating the peak value of each amplitude-frequency curve, the frequency corresponding to the first two maximum peaks are extracted simultaneously and then the corresponding period is calculated as the possible period of each image column. On this basis, NDMF is calculated to determine the final period of each image column. The traditional distance matching function (DMF) proposed by [PERSON] et al. [24] is the most used method for period estimation, which is based on the gray level co-occurrence matrix (GLCM) inertial characteristics [24]. In practice, to improve its robustness to the data differences, enhance the stability of the algorithm and reduce the amount of computation, the normalized distance matching function (NDMF) is often used [25]. To meet the period estimation demand of the corrugation interval image, a simplified NDMF of a one-dimensional image function \(l_{j}\) with \(h\) pixels in corrugation interval is defined as  
\[NDMF(d)=\frac{1}{H-d}\sum_{i=1}^{H-d}|l_{j}(i)-l_{j}(i+d)| \tag{21}\]  
where \(H\) represents the height of the corrugation interval image. \(l_{j}\) stands for a column of the corrugation interval image at position \(j\). First of all, let \(d_{i1}\) and \(d_{i2}\) be the potential periods corresponding to the maximum and the second maximum peak value of the amplitude-frequency curve of image column \(l_{i}\), respectively. Then, the NDMF values of \(d_{i1}\) and \(d_{i2}\) are calculated to determine the exact period, which is given by  
\[NDMF_{i1}(d_{i1})=\frac{1}{H-d_{i1}}\sum_{j=1}^{H-d_{i1}}|l_{ij}-l_{i(j+d_{i1} )}| \tag{22}\]  
\[NDMF_{i2}(d_{i2})=\frac{1}{H-d_{i2}}\sum_{j=1}^{H-d_{i2}}|l_{ij}-l_{i(j+d_{i2} )}| \tag{23}\]  
where \(H\) denotes the height of the corrugation interval image. Given the definition of NDMF, the smaller the NDMF value calculated by Equation (21) is, the greater the probability that it is the real period is. Hence, the final period of the image column \(l_{i}\) is \(p_{i}=\text{min}(NDMF_{i1},NDMF_{i2})\). Figure 10: The frequency-amplitude curves of some corrugation interval columns.