# Stitching-Based Resolution Enhancement in Wavefront Phase Measurement of Silicon Wafer Surfaces
## 3 System Calibration
### Distortion  
All real optical systems are affected by optical aberration, which causes distortion over the captured images. In order to estimate and correct for the distortion, a calibration mask is used. Knowing the spacing between the circles, it is possible to determine the distortion caused by the optical elements. Correcting the distortion is also a key step in correctly stitching together consecutive measurements. First, the circles are detected in the field of view provided by the sensor. Knowing the system magnification and the pixel size sensor, it is possible to obtain the pixel size in the object plane, which in this case is 7.56 \(\upmu\)m. With these data and the known distances between the circles of the calibration mask, it is possible to obtain the deviation of each circle from its real position, as shown in Figure 9.  
The process of creating an interpolant involves approximating the differences between the real and theoretical positions of the circles using a mathematical framework based on data triangulation and cubic interpolation. Initially, the input data points are triangulated using Qhull, a computational geometry tool that generates a non-overlapping triangulation of the points in a two-dimensional plane. This results in a mesh of triangles whose vertices correspond to the given data points. The process of triangulating input data points using Qhull involves dividing a two-dimensional domain into non-overlapping triangles whose vertices correspond to the given data points. Mathematically, this is described as follows: given a set of points \(S=\left\{\left(x_{i},y_{i}\right)\right\}_{i=1}^{n}\) in the plane, a triangulation \(T\) is a collection of triangles such that each vertex of every triangle in \(T\) belongs to the set \(S\). Additionally, any two triangles in the triangulation intersect only at a shared vertex or a shared edge, ensuring non-overlapping boundaries. The union of all triangles in the triangulation covers the convex hull of the set \(S\), denoted as Conv(S). Each triangle in the triangulation can be mathematically represented by three vertices. For a triangle \(\Delta_{k}\) with vertices \(\left(x_{i},y_{i}\right),\left(x_{j},y_{j}\right)\), and \(\left(x_{k},y_{k}\right)\), its geometric definition is expressed as the convex hull of these points:  
\[\Delta_{k}=\text{conv}\left\{\left(x_{i},y_{i}\right),\left(x_{j},y_{j}\right),\left(x_{k},y_{k}\right)\right\}. \tag{14}\]  
Qhull typically performs Delaunay triangulation, which optimizes the triangulation by maximizing the minimum interior angle of all triangles, thereby avoiding narrow elongated triangles. This criterion is achieved by ensuring that no point in the set \(S\) lies  
Figure 9: Real and theoretical positions of circle centers. inside the circumcircle of any triangle in the triangulation. This condition can be verified mathematically using a determinant-based test. For a triangle with vertices \((x_{i},y_{i})\), \((x_{j},y_{j})\), and \((x_{k},y_{k})\) and a point \((x_{l},y_{l})\) from the set \(S\), the circumcircle condition is satisfied if the following determinant is positive:  
\[ \begin{vmatrix}x_{i}&y_{i}&x_{i}^{2}+y_{i}^{2}&1\\ x_{j}&y_{j}&x_{j}^{2}+y_{j}^{2}&1\\ x_{k}&y_{k}&x_{k}^{2}+y_{k}^{2}&1\\ x_{l}&y_{l}&x_{l}^{2}+y_{l}^{2}&1\end{vmatrix} >0. \tag{15}\]  
If this inequality holds for all triangles and points in the set, then the resulting triangulation satisfies the Delaunay condition. Thus, Qhull computes an optimal triangulation by ensuring that the triangles are non-overlapping, fully cover the convex hull of the points, and adhere to the Delaunay property, creating a structure suitable for smooth and efficient interpolation. A cubic piecewise interpolation is then applied over the triangulated domain. This interpolation constructs distinct cubic polynomials for each triangle, ensuring a smooth approximation of the data.