## 4 Experiments
### Image Filtering Experiment  
After completing image enhancement, the proposed method is compared with Gaussian, median, and mean filtering. For a more intuitive qualitative analysis, the image of the fastener area after filtering is intercepted. Some experimental results are shown in Figure 9, in which the convolution kernel of Gaussian filtering, median filtering, mean filtering, and the filtering diameter of bilateral filtering are taken as 5. By comparison, it can be seen that Gaussian, median, and mean filtering blur some edge details of the spike in smoothing the image. In contrast, bilateral filtering can better ensure noise reduction while maintaining the edge of the spike.  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline
**Serial Number** & **1** & **2** & **3** & **4** & **5** & **6** & **7** & **8** & **9** & **10** \\ \hline Gray mean value & 139.38 & 72.50 & 91.6 & 81.51 & 105.67 & 60.75 & 151.77 & 164.73 & 78.39 & 49.59 \\ Original image & 7.51 & 6.77 & 7.12 & 6.97 & 7.30 & 6.99 & 7.60 & 6.94 & 7.22 & 6.77 \\ Enhanced image & 7.80 & 7.52 & 7.63 & 7.61 & 7.80 & 7.63 & 7.88 & 7.10 & 7.69 & 7.51 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The information entropy of some sample images.  
\begin{table}
\begin{tabular}{c c c} \hline \hline The Average Entropy of the Original Images & The Average Entropy of the Enhanced Images \\ \hline \hline \multicolumn{2}{c}{7.36} & 7.75 \\ \hline \hline \end{tabular}
\end{table}
Table 2: The average information entropy of all sample images.  
Figure 9: Image filtering effect: (**a**) original image; (**b**) enhanced image; (**c**) Gaussian filtering; (**d**) median filtering; (**e**) mean filtering; (**f**) bilateral filtering.  
At the same time, the Signal-to-Noise Ratio (SNR) and Peak Signal-to-Noise Ratio (PSNR) are introduced as the evaluation indicators for the filtering effect of quantitative analysis. The higher the SNR value, the better the filtering effect, indicating that the helpful information in the image is higher than the interference information. The higher the PSNR value, the closer the filtered image quality is to the original image and the higher the image quality. The comparison results are shown in Tables 3 and 4. SNR and PSNR are defined as shown in Formulas (16) and (17), respectively:  
\[SNR=10\times\lg(P_{s}/P_{n}) \tag{16}\]  
In the formula, \(P_{s}\) is the signal's average power, \(P_{n}\) is the average power of the noise, and \(SNR\) is in dB. Formula (17) is defined below:  
\[PSNR=10\times\lg(\frac{h\times w\times 255^{2}}{\sum\limits_{i=1}^{h}\sum \limits_{j=1}^{w}\left(f(i,j)-g(i,j)\right)^{2}}) \tag{17}\]  
In the equation, \(f(i,j)\) is the gray value of the image at \((i,j)\), \(g(i,j)\) is the gray value of the filtered image at \((i,j)\), H and \(w\) are the length and width of the image, and the \(PSNR\) unit is dB.  
In Tables 3 and 4, it can be seen that the SNR value and PSNR value of the bilateral filtering algorithm used in this paper are higher than those of other filtering algorithms, so the noise reduction effect of bilateral filtering is better, the image quality is higher, and it will not introduce too much distortion.