## 4 Results and Discussion
### Binary Process  
There are many techniques for analyzing images. Among them, the simplest and easiest method is to binarize an image using a threshold value. It is used in many preprocessing steps in image processing, such as separating the background from objects in an image, extracting only pixels with a brightness value above a certain level, or simplifying all the information in an image. The Otsu algorithm is the most representative method for calculating the threshold of an image [20,41,42].  
The Otsu algorithm is a method of calculating the optimal threshold for classifying images into two classes using a histogram based on gray scale [43]. In order to classify the image into two classes, an appropriate threshold value, k (where, 0 < k < L - 1), must be calculated. Based on the threshold value, k, in the binarized image, [0, k] is classified as 'class 1', and [k + 1, L - 1] is 'class 2'. Through this process, a binarized image can be obtained. In general, converting a 2D thermal image into a binarized image can clearly characterize the signature of the defect.  
In order to classify the two binarized images, it is necessary to calculate the optimal threshold. When there is an M \(\times\) N size image having L intensity levels, such as [0, 1, 2,..., L - 1], pixels having intensity values within are classified as class 1, and intensity values within are classified as class 2. The probability that a pixel is classified into 'class 1' and 'class 2' is as follows:  
\[\text{P}_{1}(\text{k})=\sum_{\text{i=0}}^{\text{k}}\text{P}_{\text{i}} \tag{6}\]  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Filter Type**} & \multirow{2}{*}{**5 mm/s**} & \multirow{2}{*}{**10 mm/s**} & \multirow{2}{*}{**15 mm/s**} & \multirow{2}{*}{**20 mm/s**} \\ \hline Raw & 38.5549 & 35.4555 & 25.8822 & 27.1765 \\ (non-filtering) & 54.6857 & 39.0084 & 29.1514 & 33.3562 \\ Median & 50.9123 & 38.6698 & 37.7273 & 39.4107 \\ Gaussian & 33.6764 & 36.1395 & 32.6425 & 33.4680 \\ NLmeans & 35.7586 & 36.2160 & 34.7896 & 13.4450 \\ \hline \hline \end{tabular}
\end{table}
Table 4: The value of the SNR for each filtering image.  
\[\mathrm{P_{2}(k)}=1-\mathrm{P_{1}(k)} \tag{7}\]  
The average intensity values of the pixels classified into classes 1 and 2 are as follows:  
\[\mathrm{m_{1}(k)}=\frac{1}{\mathrm{P_{1}(k)}}\sum_{i=0}^{k}\mathrm{iP_{i}} \tag{8}\]  
The average intensity values up to the k level among all images are as follows:  
\[\mathrm{m_{G}}=\mathrm{P_{1}m_{1}+P_{2}m_{2}} \tag{9}\]  
To calculate the optimal threshold, the Otsu algorithm must apply the concept of between-class variance, as follows [44]:  
\[\mathrm{\sigma_{b}^{2}}=\frac{\left(\mathrm{m_{G}P_{1}-m}\right)^{2}}{\mathrm{ P_{1}(1-P_{1})}} \tag{10}\]  
Calculating the optimal k value is a simple principle, but it can be calculated only by substituting all k values in the intensity range [0, L - 1]. The k value was calculated using MATLAB software, and the principle of the Otsu algorithm is to classify the binarization based on the k value obtained in this way. The Otsu algorithm was applied for the binarization of the image with the highest SNR improvement at each speed, as shown in Figure 11.  
In Figure 11, all defects in row 1 were not detected. For this reason, although there was a thermal contrast with the sound area, as shown in Figure 9, it could be seen as a result of the relatively small diameter and shallow depth of the defect.  
In the binarized image, even if filtering is applied, it can be confirmed that noise is present. In addition, heat was generated locally due to [PERSON]'s effect on the edge of the image, and it was classified as a light and dark value, similar to a defect. In this case, noise was removed through a morphological operation, and a process of homogenizing defect boundaries was performed for automatic object recognition.