# Stitching-Based Resolution Enhancement in Wavefront Phase Measurement of Silicon Wafer Surfaces
## 3 System Calibration
### Perpendicularity Between Linear Stages  
The importance of assigning global coordinates to our measurements is crucial. In real life, achieving two perfectly perpendicular stages is difficult, and a calibration mask is needed for correction (see Figure 7). Both the camera angle and the perpendicularity between linear stages are corrected by rotational and translation transformations of the images.  
In order to correct the camera angle and perpendicularity between linear stages, a change of basis has to be performed. This change of basis consists of rotation and translation.  
Figure 8 shows the required transformations. A simple change of basis is applied by using Equation (9) to convert the measurements from the local coordinate system (x, y) to a global coordinate system (u, v).  
Figure 6: Camera angle.  
Figure 7: Calibration mask. The mask is 300 \(\times\) 300 mm wide with 2401 circles. Each circle has a radius of 3 mm, and the distance between them is 6 mm.  
\[\mathbf{T}=\mathbf{\overline{kT}}=\left[\begin{array}{ccc}\cos(\theta)&-\sin( \theta)&\cos(\theta)s_{x}-\sin(\theta)s_{y}\\ \sin(\theta)&\cos(\theta)&\sin(\theta)s_{y}\\ 0&0&1\end{array}\right] \tag{9}\]  
In the above equation, \(\theta\) is the angle of the camera, while \(s_{x}\) and \(s_{y}\) are the number of pixels of mismatch between consecutive measurements due to stage errors and perpendicularity. First, to obtain the rotation angle, which includes the error due to the rotated camera, we calculate the largest square inscribed onto a single image of the calibration mask and transform it into a frequency space. The orientation of the repetitive pattern of the calibration mask can be easily detected. We run through different angles and check where the sums of middle horizontal and vertical lines are maximum. Second, when the images have been rotated, the common part of two consecutive images is selected. This is possible because we know the sensor pixel size, displacement, and magnification. The best way to find the values of \(s_{x}\) and \(s_{y}\) is to select the same circle in the overlapped part of both images. Later, a phase correlation is applied to the images to estimate the relative translation offset between them. The phase correlation is performed first by transforming both images into the frequency domain:  
\[\mathbf{G}_{a}=\mathcal{F}\{g_{a}\},\mathbf{G}_{b}=\mathcal{F}\{g_{b}\} \tag{10}\]  
where \(g_{a}\) and \(g_{b}\) are the input images. We calculate the cross-power spectrum by taking the complex conjugate of the second result, multiplying the Fourier transforms together element-wise, then normalizing this product element-wise.  
\[R=\frac{\mathbf{G}_{a}\circ\mathbf{G}_{b}^{*}}{\left|\mathbf{G}_{a}\circ \mathbf{G}_{b}^{*}\right|} \tag{11}\]  
We then obtain the normalized cross-correlation by applying the inverse Fourier transform.  
\[r=\mathcal{F}^{-1}\{R\} \tag{12}\]  
The peak in \(r\) provides the values of \(s_{x}\) and \(s_{y}\).  
\[(s_{x},s_{y})=\arg\max_{(x,y)}\{r\} \tag{13}\]  
This transformation must be applied to all captured images before stitching is performed.  
Figure 8: Transformation from local (x, y) to global (u, v) coordinates. The transformation consists of a rotation followed by a translation.