## 2 Methodology
### Viewpoint Transformation  
The viewpoint transformation module adjusts and corrects the viewpoints of pavement distress images from different target domains. It aligns images from various viewpoints to a unified bird's-eye view. This eliminates irrelevant factors caused by perspective variations  
Figure 4: The network structure of domain prior knowledge generator. and improves the accuracy of pavement distress detection. When transferring a well-trained pavement distress detection model from the source domain to the target domain, the differences in image perspectives between the source and target domains significantly impact the accuracy of pavement distress detection. When the viewpoint is slanted, the features of pavement distress are often obscured due to occlusion issues and distorted due to viewpoint problems. Therefore, when transferring a well-trained model from the source domain to the target domain, it is necessary to adjust the viewpoint of collected pavement images. The viewpoint transformation module allows the pavement distress detection model to detect distress from a unified bird's-eye view perspective, ensuring that the pavement distress detection model can extract pavement distress features as comprehensively as possible. Considering that pavement can be viewed as a plane when capturing pavement conditions using images, while pavement distress appears as irregular patterns on this plane, when capturing pavement images from different viewpoints, the pavement plane is projected onto the vertical plane of the viewpoint, leading to occlusion and deformation of pavement distress. Therefore, adjusting the viewpoint of pavement images to fix them in a unified perspective can be seen as finding the position and angle relative to the pavement of the shooting source, thus restoring the image with current perspective distortion to the original image in bird's-eye view. Furthermore, the above task can be viewed as finding the position and distance relative to the shooting source for each point in the pavement image, thereby enabling the image to be restored. Specifically, the domain prior knowledge generator first generates a large number of proposal line points. This is because, after extensive self-supervised training on numerous target domain images, the domain prior knowledge generator can effectively extract key information from any target domain image, which is stored in these key points. Next, the Hough transform is employed to detect lines formed by these proposal line points. Typically, in a bird's-eye view, lines such as lane markings are parallel to each other; however, from different viewpoints, these parallel lines may intersect. Therefore, the lines detected using the Hough transform can extract viewpoint information. The Hough Transform is a technique for identifying collections of points in the parameter space that represent specific geometric shapes, commonly used for detecting shapes such as lines and circles in images. Based on this, any pavement images captured from an arbitrary angle can be transformed into a pavement image in space according to the following equation:  
\[ \begin{pmatrix}x\\ y\\ z\end{pmatrix} = \begin{pmatrix}a_{11}&a_{12}&a_{13}\\ a_{21}&a_{22}&a_{23}\\ a_{31}&a_{32}&a_{33}\end{pmatrix}\begin{pmatrix}m\\ n\\ 1\end{pmatrix}  \tag{1}\]  
Transformed into a bird's-eye view:  
\[ \begin{pmatrix}x\prime\\ y\prime\\ 1\end{pmatrix} = \begin{pmatrix}x/z\\ y/z\\ z/z\end{pmatrix} = \begin{pmatrix}\frac{a_{11}x+a_{12}y+a_{12}}{a_{13}x+a_{12}y+a_{ 13}}\\ \frac{a_{21}x+a_{22}y+a_{23}}{a_{21}x+a_{23}y+a_{23}}\\ 1\end{pmatrix}  \tag{2}\]  
where (\(m\), \(n\)) represents the pavement image captured from any viewpoint, while (\(x^{\prime}\), \(y^{\prime}\)) represents the pavement image under the bird's-eye view perspective; \( \begin{pmatrix}a_{11}&a_{12}&a_{13}\\ a_{21}&a_{22}&a_{23}\\ a_{31}&a_{32}&a_{33}\end{pmatrix} \) is determined based on the position of the camera and the viewpoint.