# An Optimized Genetic Algorithm-Based Wavelet Image Fusion Technique for PCB Detection
## 4 Experiment Results and Discussion  
This study employs a comprehensive set of evaluation metrics for image fusion assessment, encompassing RSD, PSNR, SF, and image clarity. In addition, the experimental platform includes a 13 th Gen Intel(R) Core(TM) i9-13900 HX 2.20 GHz (Intel Corporation, Santa Clara, CA, USA) and an NVIDIA GeForce RTX 4060 Laptop GPU (NVIDIA Corporation, Santa Clara, CA, USA). The designed model first loads the two images to be fused from the specified file paths, retrieves the previously imported image data through the handles structure, converts these data into a double-precision matrix, and normalizes it to a range between 0 and 1. Subsequently, the dimensions of the two images are made identical using the clip_images function. The two images are then decomposed using a two-dimensional wavelet transform. Following this, the wavelet coefficients of the two images are input into an enhanced genetic algorithm with improvements. Initially, the algorithm generates a random initial population, where each individual represents a potential solution. Each individual is evaluated using a fitness function, which is designed to assess the quality of the current solution. In this study, the fitness function incorporates the RSD, PSNR, SF, and image clarity as evaluation criteria. During the selection process for each generation, the individual with the highest fitness is retained, leading to the identification of the optimal solution. This approach accelerates the convergence of the genetic algorithm and ensures that high-quality solutions are preserved, ultimately yielding the best fusion weight combination. A set of image fusion results is illustrated in Figure 1. Figure 1a,b show the original images to be fused, while Figure 1c presents the final fusion result. A total of ten image groups were used for testing in this study, with the results presented in Table 1.  
Based on the results, the RSD values of the improved method are generally close to or equal to 1, indicating that the enhanced image stability has not significantly improved. In some cases, the RSD values have slightly increased, such as in Test4, which rose from 0.91353 to 0.91938. However, the proposed method demonstrates outstanding performance in enhancing PSNR, SF, and overall image clarity, leading to a significant improvement in image quality. The PSNR values after enhancement show a notable increase, particularly in Test1-enhanced and Test5-enhanced, where the values are substantially higher than those of the original test method. This suggests that the enhancement process effectively improves image quality and reduces noise. Although there are a few cases where the PSNR did not increase significantly or decrease slightly, the overall trend indicates an improvement in PSNR after enhancement. The SF generally exhibits an upward trend following enhancement, implying that the enhancement operation typically improves image details and sharpness. While some tests show a slight decrease in SF, the overall effect suggests that enhancement contributes to increased spatial frequency. Furthermore, image clarity is generally improved, with the enhancement process demonstrating a significant effect in enhancing image sharpness, particularly in the representation of image details. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Testing** & **RSD** & **PSNR** & **SF** & **Image Clarity** \\ \hline Test1 & 0.98136 & 32.5008 & 149.545 & 439.8995 \\ Test1-enhanced & 0.99999 & 97.8943 & 220.2694 & 679.6867 \\ Test2 & 1.0301 & 30.3599 & 120.1008 & 178.4979 \\ Test2-enhanced & 1 & 112.1457 & 80.0046 & 114.7729 \\ Test3 & 0.97715 & 29.2599 & 51.2645 & 132.952 \\ Test3-enhanced & 1 & 114.5844 & 112.0137 & 249.4875 \\ Test4 & 0.91353 & 19.1415 & 564.3926 & 1940.7664 \\ Test4-enhanced & 0.91938 & 21.2168 & 551.8391 & 1928.7157 \\ Test5 & 0.92662 & 30.5541 & 70.7639 & 199.5201 \\ Test5-enhanced & 1 & 137.9181 & 154.353 & 301.5207 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Performance results of image fusion.