# Calibration and Image Reconstruction in a Spot Scanning Detection System for Surface Defects
## 2 Spot Scanning Surface Defect Evaluation System
### Ideal Scanning Trace and Image Reconstruction  
Two coordinate systems need to be established for the analysis of scanning trace and image reconstruction. The first one is the three-dimensional system coordinate system \(O_{\mathrm{s}}-X_{\mathrm{s}}Y_{\mathrm{s}}Z_{\mathrm{s}}\), as shown in Figure 1, which takes the horizontal two-dimensional translation stage as the \(x\)-axis and the \(y\)-axis, the vertical up as the \(z\)-axis, and the intersection of the axis of the rotation stage (the rotation axis) and  
Figure 1: Layout of the spot scanning surface defect evaluation system.  
the optical surface as the origin. The second one is the two-dimensional surface coordinate system \(O_{e}-X_{e}Y_{e}\). It coincides with \(O_{s}-X_{s}Y_{s}\) at the initial system state (that is, both the rotation stage and the two-dimensional translation stage are at their own original positions). During scanning, both of them will move under the driving of the positioning system, and the surface coordinate system will also rotate as the optical surface does. Ideally, the rotation axis coincides with the \(Z_{s}\) axis, and the illuminated spot at the initial system state (called the initial illuminated spot) is at point \(O_{s}\). Figure 2 illustrates the scanning diagram of the system under ideal conditions. The positioning system translates along the negative direction of the \(Y_{s}\) axis at a constant velocity of \(v\) and rotates counterclockwise at an angular velocity of \(\omega\). At any scanning time \(t\), as shown in Figure 2a, the coordinate of the illuminated spot \(p(t)\) in the system coordinate system is \((0,vt,0)\), and the rotation angle of the surface coordinate system relative to the system coordinate system is \(\phi(t)=\omega t-2\pi\times NR\), where \(NR\) represents the number of revolutions that have been rotated. Hence, the coordinate of \(p(t)\) in the surface coordinate system, \(\left(p_{e}^{x}(t),p_{e}^{y}(t)\right)\), can be calculated by rotation transformation as  
\[\left[\begin{array}{c}p_{e}^{x}(t)\\ p_{e}^{y}(t)\end{array}\right]=\left[\begin{array}{cc}\cos(\omega t)&\sin( \omega t)\\ -\sin(\omega t)&\cos(\omega t)\end{array}\right]\left[\begin{array}{c}0\\ vt\end{array}\right]=\left[\begin{array}{c}vt\sin(\omega t)\\ vt\cos(\omega t)\end{array}\right]. \tag{1}\]  
The intensity signals detected by each PMT are acquired and recorded with a sampling frequency of \(f\), forming a discrete intensity sequence \(I_{0},I_{1},\cdots,I_{N-1}\), where \(N\) is the total number of sampling points. Figure 2b presents the spiral scanning trace and the distribution of sampling points. For each sampling point in the sequence, the corresponding scanning time depends on its sequence number \(n\), as \(t_{n}=n/f\), and the corresponding intensity signal is \(I_{n}\). By using Equation (1), the coordinate of the sampling point in the surface coordinate system can be obtained, which is subsequently converted to the image coordinate in the reconstructed image by  
\[n\rightarrow(u_{n},v_{n})^{T}:\left\{\begin{array}{l}u_{n}=\frac{p_{e}^{x} (n/f)}{k_{0}}+u_{0}\\ v_{n}=\frac{p_{e}^{x}(n/f)}{k_{0}}+v_{0}\end{array}\right.,n=0,1,\cdots,N-1, \tag{2}\]  
where \((u_{0},v_{0})\) is the image coordinate of the first sampling point with \(n=0\), which needs to be preset according to the actual scanning range to ensure that the image coordinates of all sampling points are positive; the coefficient \(k_{0}\) represents the actual size of each pixel. In the SS-SDES, the value of \(k_{0}\) is equal to the translation distance of the positioning system by a single revolution, defined as \(k_{0}=2\pi v/\omega\). Combined with the derived image coordinates and corresponding intensity signals, a complete defect image can be reconstructed.  
Figure 2: Schematic of the ideal scanning. (**a**) System state at scanning time \(t\); (**b**) Scanning trace and the distribution of sampling points (for intuitive understanding the spacing is enlarged).