## 3 Experimental Results
### Focus Measure  
A systematic comparison scheme was designed in this study, focusing on two aspects: extraction performance and computational efficiency. First, the focus region extraction results on the same test samples are compared to generate focus measure maps and assess the accuracy of focus determination. Second, the real-time performance is evaluated by measuring the computation time each algorithm takes to process the same image. During the experiments, variables such as lighting and displacement of samples were strictly controlled to ensure the reliability and repeatability of the comparison results. In Figures 12-16, the focus measure maps and decision maps generated by the variance, gradient, Laplacian energy, spatial frequency methods, and the proposed algorithm are presented. Figure 6: (**a**–**i**) are section images of ten-year pine stem c.s. at different focal planes. Figure 8: (**a**–**i**) are section images of housefly wing w.m. at different focal planes. Figure 7: (**a**–**i**) are section images of Capsella older embryo sec. at different focal planes. Figure 9: (**a**–**i**) are images of circuit board samples at different focal planes. Figure 11: (**a**–**i**) are images of sensor circuit samples at different focal planes. Figure 12: The left and middle images are focus maps based on Gray-Level Variance, while the right, one is a corresponding decision map. Figure 10: (**a**–**i**) are images of battery holder circuit samples at different focal planes. Figure 16: The left and middle images are focus maps based on Proposed, and the right one is a corresponding decision map. Figure 13: The left and middle images are focus maps based on Energy of Gradient, and the right one is a corresponding decision map. Figure 14: The left and middle images are focus maps based on Energy of Laplacian, and the right one is a corresponding decision map. Figure 8:0 The left and middle images are focus maps based on Spatial Frequency, and the right one is a corresponding decision map. appears in non-edge regions, leading to local misjudgments in the decision map. First-order gradients are sensitive to high-frequency noise, which can generate false focus signals in low signal-to-noise ratio scenarios like microscopic imaging. In the Laplacian energy method, the decision map contains speckled white noise and irregular patches at the boundaries between bright and dark areas. Since it relies solely on second-order differential features, it responds poorly to low-frequency brightness variations and fails to effectively distinguish between defocus blur and true low-frequency textures. In the spatial frequency method, the focus measure map has a blurred response in the low-frequency region and an uneven energy distribution of high-frequency details, resulting in severe noise in the blank area of the sample in the decision map and low boundary detection accuracy. The focus map generated by the proposed method shows significantly enhanced detail-to-background contrast, and the decision map presents continuous and complete focused regions. Although slight over-extraction occurs at complex edges, it does not affect the subsequent image fusion performance after post-processing. Table 1 shows the computation time under the same operating environment (Platform: Intel\({}^{\text{\text{\textregistered}}}\) CoreTM i7-9750H, Santa Clara, CA, USA). It can be seen from the data in Table 1, the gray-level variance method only needs to calculate the mean and variance of pixel intensity, without complex convolution kernels and Fourier transform, and has the fastest processing speed. The gradient energy method employs convolution operations to compute gradients, leading to a slightly higher computational time compared to the gray level variance method. Similarly, the Laplacian energy method also utilizes convolution operations, resulting in computational times comparable to those of the gradient energy method.