## 2 Methods
### Focused Region Detection  
In microscopic images, the observed objects (such as cells, tissues, circuit boards, etc.) typically have complex three-dimensional structures. These objects exhibit different sharp regions at different focal planes, which are usually composed of edges and texture details. Edges are regions where significant changes in pixel intensity occur, often representing the contours and boundaries of objects, while texture details refer to the fine, intricate structures or patterns on the object's surface. In order to reduce the computational complexity of the algorithm in embedded devices, the input image is down-sampled before focus region detection. Regional interpolation down-sampling generates the pixel values of the new image by averaging multiple pixels in the source image, which is represented as  
\[\text{I}_{\text{src-down}}(\text{x},\text{y})=\frac{1}{4}\text{$\sum_{i=0}^{1 }\text{$\sum_{j=0}^{1}\text{I}_{\text{src}}(2\text{x}+\text{i},2\text{y}+\text {j})$}}, \tag{1}\]  
Figure 1: The framework of the fusion algorithm. where I\({}_{\text{src}}\) is the source image, and I\({}_{\text{src-down}}\) is the down-sampled image. The coordinates of I\({}_{\text{src}}\) are mapped to the coordinates of I\({}_{\text{src-down}}\). The value of the target image I\({}_{\text{src-down}}\) is the average value of the corresponding region in the original image. By calculating the average value of each 2 \(\times\) 2 image block from the original image, we obtain the pixel values for the target image. For example, the input source image resolution is 3840 \(\times\) 2160, and the resolution of the down-sampled image I\({}_{\text{src-down}}\) is 1920 \(\times\) 1080, which reduces the data size compared to the source image. Difference of Gaussians is commonly used for edge detection and feature extraction. It is obtained by applying Gaussian blur at different scales to the image and calculating the difference between the two blurred images. The difference of Gaussians image allows for the preliminary extraction of edges and contours of the object. The specific calculations are shown in Equations (2) and (3). \[\text{G}(\text{x},\text{y},\sigma)=(1/2\pi\sigma^{2})\times\exp{[-(\text{x}^{2 }+\text{y}^{2})/2\sigma^{2}]}, \tag{2}\]  
\[\text{I}_{\text{dog}}(\text{x},\text{y})=\text{I}_{\text{src-down}}(\text{x},\text{y})*\text{G}(\text{x},\text{y},\sigma_{1})-\text{I}_{\text{src-down}}( \text{x},\text{y})*\text{G}(\text{x},\text{y},\sigma_{2}) \tag{3}\]  
where G\((\text{x},\text{y},\sigma)\) is the Gaussian kernel function, with \(\sigma\) being the standard deviation of the Gaussian kernel. A larger \(\sigma\) results in a stronger blurring effect on the image. I\({}_{\text{src-down}}\) is the partially focused down-sampled microscopic image, and the Gaussian kernels with different standard deviations \(\sigma\) are convolved with I\({}_{\text{src-down}}\) and then subtracted to obtain the difference of Gaussians image I\({}_{\text{dog}}\). As shown in Figure 2, when setting \(\sigma_{1}=1.5\) and \(\sigma_{2}=1.2\), I\({}_{\text{dog}}\) extracts most of the edge information and some of the local detail features of the image. Image pyramids are typically divided into two types: Gaussian pyramids and Laplacian pyramids. Through image pyramids, multi-scale image features can be extracted. The Laplacian pyramid is constructed based on the Gaussian pyramid and is used to capture and represent the detailed texture information of the image. First, the Gaussian pyramid is constructed by convolving the image I\({}_{\text{src-down}}\) with the Gaussian kernel function and then down-sampling. After the first down-sampling, the image size becomes one-quarter of the original image. This operation is repeated k times to obtain k levels of the Gaussian pyramid. The image at the k-th level I\({}_{\text{gauss}}^{\text{k}}\) can be expressed by Equation (4), \"DOWN\" represents down-sampling, which removes even rows and even columns. \[\text{I}_{\text{gauss}}^{\text{k}}(\text{x},\text{y})=\left\{