## 2 Materials and Methods
### Depth of Focus 3D Reconstruction
The size of the blur circle directly affects the clarity of the image, which is usually quantified by local contrast or high-frequency components. The core assumption of Depth from Focus DFF is that for each scene point, there is a fixed focus position \(\mathbf{f}\) that makes the image at the corresponding image distance \(\mathbf{v}\) the clearest. Image clarity shows a unimodal characteristic as the focus position changes, usually approximating a Gaussian distribution. The focal length \(\mathbf{f}\) and aperture \(\mathbf{A}\) of the camera remain unchanged during the acquisition process. Based on these assumptions, DFF scans the focus position to the position where each pixel has the highest clarity, and then infers the depth. In DFF, the camera collects a series of images by adjusting the focal length \(\mathbf{f}\) or the image distance \(\mathbf{v}\). Assuming that the camera adjusts the image distance \(\mathbf{v}\) (common in microscope systems), for a certain scene point, when its object distance is \(\mathbf{u}\), the condition for the clearest image is as shown in the formula. This formula shows that the object distance \(\mathbf{u}\) (depth) can be calculated by the focal length \(\mathbf{f}\) and the clearest image distance \(\mathbf{v}\). \[\mathbf{u}=\frac{\mathbf{fv}}{\mathbf{v}-\mathbf{f}} \tag{19}\]  
Image sharpness \(\mathbf{S}(\mathbf{x},\mathbf{y},\mathbf{v})\) is a function of position \((\mathbf{x},\mathbf{y})\) and image distance \(\mathbf{v}\). DFF assumes that sharpness reaches its maximum value near the focus position. Commonly used sharpness metrics include variance \(\mathbf{S}=\sum\left(\mathbf{I}-\mathbf{I}\right)^{2}\). For each pixel \((\mathbf{x},\mathbf{y})\), the image distance \(\mathbf{v_{\max}}\) that maximizes its sharpness should be found  
\[v_{max}=argmax_{\mathbf{v}}S(x,y,\mathbf{v}) \tag{20}\]  
Substituting \(\mathbf{v_{\max}}\) into the Gaussian lens formula  
\[u(x,y)=\frac{fv_{max}}{v_{max}-\mathbf{f}} \tag{21}\]  
This is the depth formula of DFF, which expresses the relationship between the depth \(\mathbf{u}(\mathbf{x},\mathbf{y})\) of each point \((\mathbf{x},\mathbf{y})\) in the scene and the clearest image distance \(\mathbf{v_{\max}}\). When the image distance deviates from v_max, the blur circle diameter \(\mathbf{C}\) increases and the clarity decreases. The implementation method of the focal plane scanning method based on the processing of defocused image sequences is mainly the focus depth method. This search-based method requires obtaining a sequence of 10-20 defocused images of the target object, and using different forms of focus evaluation functions to analyze the clarity of the pixels to form discrete function values. The focus evaluation function is fitted with the help of a fitting algorithm [25], and then the function peak is searched. The distance corresponding to the peak is the depth of the pixel. To accurately map image coordinates to real-world dimensions, a custom-designed microscopic calibration target with grid features of known size (10 \(\mu\)m) was used. Bycapturing multiple images at different focus levels, the intrinsic parameters (focal length, principal point, distortion coefficients) and extrinsic parameters (relative position and orientation) of the camera were calibrated using a standard pinhole imaging model and [PERSON]'s calibration method [Ref]. This process yielded the scale factor (\(\upmu\)m/pixel), which was then applied to map the reconstructed image size to the actual dimensions of the ablation crater. The hardware part of the DOF system is an electric platform, CCD camera, lens controller, and computer. The selection of the camera part is as follows: (1) Electric platform: The camera lens used in the spectral confocal zoom system built in this paper is an optical product of Qiheng Optics Co., Ltd., Changchun, China, model MZ/X10 MP-5 MP. The maximum movement can be achieved at the um level.