# Stitching: Jigsaw Puzzles in Three-Dimensional Space

The most important problem of subaperture stitching interferometry is how to stitch all the subapertures together with minimized uncertainty. Although all subapertures are successfully sampled, the measured surface pieces are randomly scattered in three-dimensional (3-D) space at different positions and orientations, as shown in Fig. 16. Taking individual subaperture measurements is only part of the entire picture. Because different aberrations are introduced to each subaperture due to uncertain misalignment, stitching optimization is like constructing a jigsaw puzzle in 3-D space. That is to say, all subapertures must be placed in the right positions and orientations to finally form the whole surface that is closest to the real one. It is much more complex than image stitching in the two-dimensional (2-D) plane.

## Mathematical background

### Surface error change related to the misalignment

We begin with the simplest case. A flat or spherical surface is measured by a standard interferometer with TF or TS. Suppose the measured data are a set of triplets W *= {**w**j = (**u**j, **V**j,* ф_{у})}, *j* = 1, 2, ..., N, where фу is the measured height (phase) on pixel *(**u**j,* Vj). N is the number of measuring points in the subaperture. As mentioned earlier, the subaperture measurement is misaligned with unknown relative positions and orientations. Basically, the misalignment is modeled by rigid transformation and lateral scaling, which is represented by a 4 x 4 matrix in homogeneous coordinates. It is a nonlinear function of the transformation parameters. However, with the small misalignment assumption, the error change Дф in height is naturally related to piston, tip-tilt, and defocus as follows:

where a, *b, c,* and d are the coefficients of piston, tip-tilt, and defocus. The defocus term is excluded when stitching flat subapertures. Conventional stitching algorithms simply use this equation to optimally remove the misalignment based on minimized overlapping inconsistency. It works for subaperture measurements with sufficiently small amounts of lateral shift, e.g., positioning error at the subpixel level. However, for a surface error with a large slope variation, it is necessary but not easy to achieve micron-level positioning. Therefore, generally, the lateral shift should also be included in the stitching model.

The error change in height with lateral shift can be derived from the slope of the surface error^{62,63}

where *p* and t are the coefficients of lateral shift, and the partial derivatives are slopes in the u and v directions, respectively.

Clocking also changes the lateral coordinates and thus changes the error in height. Therefore, it can also be related by means of slopes. For a small clocking angle 0, the lateral coordinate change is linearly related as follows:

The error change with the clocking angle is, therefore, derived from the slope

Consequently all misalignment coefficients are linearly related to the error change with defocus excluded for flat subapertures

Slope calculation is fundamental to linearly relate the error change with the misalignment. We can usually approximate the surface slopes by numerical differences. For scattered data points with uneven spacing, we apply Delaunay triangulation and find at least two nearest points to estimate the slopes in the *и* and *v *directions. Figure 17 shows the two nearest vertices *P(u,* V1, Ф1) and P2(u2, V2, Ф2) found to calculate the slope *(f _{u}, f_{v})* at point P

_{0}(u

_{0}, v

_{0}, ф

_{0}) by solving the following

**Figure 17 **Slope calculation with triangulation of scattered data points.

linear equations of a total differential approximated by numerical differences
Therefore, we obtain the closed-form solutions *(f _{u},* f) for scattered data points