# Rectification for Stitched Images with Deformable Meshes and Residual Networks
## 4 Results
### Impact of Deformable Mesh and Loss Functions on Image Rectification  
In accordance with practical application requirements, we designed three types of deformable meshes--triangle, rectangle, and regular hexagon--for predicting the rectification of irregular images. For the input size of the dataset at 512 \(\times\) 384, a uniform mesh resolution of 16 \(\times\) 12 was employed for rectification prediction. In terms of loss functions, both local and global loss terms were designed for regression prediction. Taking a random selection of 300 images from the test set of the DIR-D dataset as an example, we tested the quantitative metrics for image rectification under different method combinations (Table 4). In the table, \"\(\mathcal{W}\)\" indicates the inclusion of the current mesh shape or loss function in the combination. Figure 6: Rectification effect of different irregular images under images with more local structural information. When combining local and global loss terms on the basis of using a rectangular mesh, the overall rectification regression performance is poorer. Comparatively, the absence of the local loss term has a more significant impact on rectification. This is because the global loss term introduces substantial stretching and bending during the regression process, while the local loss term predicts the regression of rigid or curved structures based on the actual content within the mesh. If only the global loss term is used, the rectification may result in severe deformation within local structures, as they are not adequately repaired. The figures provide a more intuitive sense of the image loss resulting from different combinations, offering a direct visual representation of the changes in evaluation metrics under various combinations (Figure 7). In terms of the overall rectification performance with deformable meshes, it can be observed that the hexagon performs the best, followed by the rectangular mesh, while the triangular mesh exhibits the poorest rectification effect. This is because the hexagonal mesh has better adaptability compared to other meshes; it can effectively cover and adapt to various irregular contours, thereby enhancing the performance of the regression model [58,59]. Simultaneously, the hexagonal mesh can more compactly cover the image area, reducing redundancy. It can decrease edge effects when handling image boundaries, reducing the likelihood of extensive deformation at the image edges and thereby improving repre \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multicolumn{2}{c}{**Loss Function**} & \multicolumn{2}{c}{**Mesh Shape**} & \multicolumn{2}{c}{**Model**} & \multicolumn{2}{c}{**Quantitative Index**} \\ \hline
**Localized Loss** & **Global Loss** & **Triangle** & **Rectangle** & **Hexagon** & **Color** & **SSIM**\(\uparrow\) & **PSNR**\(\uparrow\) & **FID**\(\downarrow\) \\ \hline  & \(\mathcal{W}\) & & \(\mathcal{W}\) & & **R + G** & 0.4753 & 15.12 & 74.68 \\ \(\mathcal{W}\) & & & \(\mathcal{W}\) & & **R + L** & 0.6169 & 18.96 & 24.70 \\ \(\mathcal{W}\) & \(\mathcal{W}\) & \(\mathcal{W}\) & & **T + G + L** & 0.0771 & 20.46 & 22.02 \\ \(\mathcal{W}\) & \(\mathcal{W}\) & & \(\mathcal{W}\) & & **R + G + L** & 0.7126 & 21.05 & 21.74 \\ \(\mathcal{W}\) & \(\mathcal{W}\) & & & \(\mathcal{W}\) & **H + G + L** & 0.7203 & 21.97 & 20.68 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Influence of different loss functions and mesh shapes on image rectification. SSIM, PSNR, and FID are utilized as components in various combinations. The symbol “\(\mathcal{W}\)” denotes the inclusion of the current grid shape or loss function in the combination. The “model” column represents different combinations, where L stands for “Localized loss”, G for “Global loss”, T for “Triangle”, R for “Rectangle”, and H for “Hexagon”. Various colors are employed in the table for clear correspondence with the combination methods illustrated in Figure 7. An upward arrow in the table indicates that the larger its value, the higher the image quality, and vice versa.