## 2 Image Registration Algorithm Based on Deep Learning and Local Homography Transformation
### Sample and Label Generation Method Based on Local Homography Transformation  
In the homography matrix, the rotational and shear components are often much smaller than the translation components, so it is difficult for a model to converge if the homography matrix is used as a label directly. Therefore, [PERSON] et al. proposed a method of substituting four pairs of corresponding points for the homography matrix [14]. The algorithm uses global homography transformation and is only suitable for the registration of an image without parallax. However, the actual images usually have parallax. To overcome the shortcomings of [PERSON]'s method, an improved sample generation method based on local homography transformation is proposed to generate sample images with parallax, as illustrated in Figure 1. The sample and label generation process is described in detail as follows:  
Step 1: Firstly, add random perturbation values to the coordinates of the four corners {P\({}_{1}\), P\({}_{2}\), P\({}_{3}\), P\({}_{4}\)} of the original image \(I_{A}\) to obtain four new points {P\({}^{\prime}\), P\({}^{\prime}\), P\({}^{\prime}\), P\({}^{\prime}\)\({}_{4}\)}, where the ranges of the random perturbation values in horizontal and vertical directions are [\(-\rho_{x}\), \(\rho_{x}\)] and [\(-\rho_{y}\), \(\rho_{y}\)], respectively. The two points before and after the perturbation form a pair of corresponding points, therefore, a total of  
Figure 1: The process of the proposed sample and label generation method: (**a**) Generate four pairs of points and obtain the corresponding homography matrix \(\textbf{H}_{\text{dpt}}^{AB}\); (**b**) randomly cut out the original image to generate an \(M\times N\) uniform grid \(G_{A}\); (**c**) \(M\times N\) points \(G^{\prime}{}_{A}\) transformed from \(G_{A}\) by using \(\textbf{H}_{\text{dpt}}^{AB}\); (**d**) \(M\times N\) perturbation points \(\widetilde{G^{\prime}{}_{A}}\) generated from \(G^{\prime}{}_{A}\); (**e**) adaptively generate \(m\times n\) uniform grid; (**f**) image \(I_{B}\) transformed from \(I_{A}\) using local homography matrices \(\textbf{H}_{L}^{AB}\); (**g**) generated alternative samples; (**h**) calculation of overlap degree of two sample images. four pairs of corresponding points are obtained, as shown in Figure 1a. Then, calculate the homography matrix \(\mathbf{H}_{4 pt}^{AB}\) corresponding to the four pairs of corresponding points. Step 2: Randomly select a point \(p\) in the original image \(I_{A}\), cut out a block \(I^{\prime}{}_{A}\) with fixed size using \(p\)as the upper left corner of the block, and divide the block into a uniform grid to get \(M\times N\) grid points \(G_{A}\), as illustrated in Figure 1b. Step 3: According to Equations (1) and (2), transform the \(M\times N\) grid points \(G_{A}\) into new corresponding \(M\times N\) points \(G^{\prime}{}_{A}\) by using the homography matrix \(\mathbf{H}_{4 pt}^{AB}\), as illustrated in Figure 1c. Step 4: Add random perturbation values to each of the new corresponding \(M\times N\) points \(G^{\prime}{}_{A}\) to get \(M\times N\) perturbation points \(\widetilde{G}^{\prime}{}_{A}\), as illustrated in Figure 1d. The ranges of random perturbation values in horizontal and vertical directions are \(\left[-\rho^{\prime}{}_{x},\rho^{\prime}{}_{x}\right]\) and \(\left[-\rho^{\prime}{}_{y},\rho^{\prime}{}_{y}\right]\), respectively, and \(\rho^{\prime}{}_{x}<\rho_{x}/2\), \(\rho^{\prime}{}_{y}<\rho_{y}/2\), so as to ensure the global consistency of these random perturbation points. Step 5: Through the \(M\times N\) uniform grid points, \(G_{A}\) generated in Step 2 and \(M\times N\) corresponding perturbation points \(\widetilde{G}^{\prime}{}_{A}\) generated in Step 4, the corresponding global homography matrix \(\mathbf{H}_{S}^{AB}\) is calculated by the DLT algorithm.