## 2 Materials and Methods
### Unsupervised Homography Estimation Model
#### 2.1.1 Four-Point Parameterization Homography Estimation Layer  
This layer is the HomographyNet network model, which serves as the backbone network. It is a regression network similar to the VGG architecture. As shown in Figure 2, the network model includes 8 convolutional layers, 4 max pooling layers, 1 dropout layer, and 2 fully connected layers. The model input consists of two stacked grayscale images. After processing through convolutional layers and fully connected layers, the final output  
Figure 1: Network structure of the unsupervised homography estimation model.  
is a 4-point parameterized homography matrix, \(H_{4 points}\), which is equivalent to a \(3\times 3\) form of the homography matrix, \(H\).  
The essence of planar homography estimation is to compute the linear mapping between pixels of two images to provide a non-singular linear relationship between points in the two images. The homography matrix has 8 degrees of freedom, so theoretically, only 4 pairs of matching points are needed to estimate the result. The HomographyNet network model discards the traditional \(3\times 3\) homography matrix's rotation, translation, scaling, and other component errors that are difficult to reflect in the loss function, which can affect the training of deep neural network models. Instead, it uses a 4-point parameterized form to represent the homography matrix. The principle is as follows:  
Assuming points \(x=\left(u,\ v\right)^{T}\) and \(x^{\prime}=\left(u^{\prime},\ v^{\prime}\right)^{T}\) are a pair of 2D coordinates with a mapping relationship in the transformed image, represented in homogeneous coordinates as \(x=\left(u,\ v,\ 1\right)^{T}\) and \(x^{\prime}=\left(u^{\prime},\ v^{\prime},\ 1\right)^{T}\), the mapping relationship between the two points using the \(3\times 3\) homography matrix, \(H\), is expressed as:  
\[\begin{bmatrix}u^{\prime}\\ v^{\prime}\\ 1\end{bmatrix}=\begin{bmatrix}h_{11}&h_{12}&h_{13}\\ h_{21}&h_{22}&h_{23}\\ h_{31}&h_{32}&h_{33}\end{bmatrix}\begin{bmatrix}u\\ v\\ 1\end{bmatrix} \tag{1}\]  
As long as there are four pairs of matching points, \(\left(u_{i},\ v_{i}\right)\overset{match}{\rightarrow}\left(u_{i}^{\prime},v_{i}^{\prime}\right)\), the unique solution for \(H\) can be calculated. Similarly, as long as there are four pairs of \(\left(\Delta u_{i},\ \Delta v_{i}\right)\), the unique solution for \(H\) can also be calculated, where \(\Delta u_{i}=u_{i}^{\prime}-u_{i}\) and \(\Delta v_{i}=v_{i}^{\prime}-v_{i}\) represent the offsets of the horizontal and vertical coordinates of these four pairs of matching points. Therefore, the 4-point parameterized matrix, \(H_{4 points}\), is used to replace the \(3\times 3\) homography matrix, \(H\):  
\[H_{4 points}=\begin{bmatrix}\Delta u_{1}&\Delta v_{1}\\ \Delta u_{2}&\Delta v_{2}\\ \Delta u_{3}&\Delta v_{3}\\ \Delta u_{4}&\Delta v_{4}\end{bmatrix}\ \sim H=\begin{bmatrix}h_{11}&h_{12}&h_{13}\\ h_{21}&h_{22}&h_{23}\\ h_{31}&h_{32}&h_{33}\end{bmatrix} \tag{2}\]  
The mapping relationship between the two points \(x=\left(u,\ v,\ 1\right)^{T}\) and \(x^{\prime}=\left(u^{\prime},\ v^{\prime},\ 1\right)^{T}\) is expressed using \(H_{4 points}\) as:  
\[x^{\prime}=H_{4 points}x \tag{3}\]