## 2 Measurement Principles and Methods
### Monocular Vision Sinkage Detection Method  
In order to correctly detect wheel sinkage, the camera's exposure parameters and camera focal length need to be adjusted before starting. Camera imaging distortion and installation angle deviation can cause wheel distortion in the collected images. The actual circular wheel appears as an elliptical image in the initial photograph. Thus, it is necessary to project the image of the wheel onto a vertical surface using perspective transformation. Assuming that \((u,v)\) is the pixel coordinates of the original image and \((x,y)\) is the pixel coordinates of the corresponding perspective transformed image, the relationship between the two can be expressed as  
\[\left[ \begin{array}{c}x\\ y\\ 1\end{array} \right]=\textbf{{M}}\left[ \begin{array}{c}u\\ v\\ 1\end{array} \right]= \begin{bmatrix}\alpha_{11}&\alpha_{12}&\alpha_{13}\\ \alpha_{21}&\alpha_{22}&\alpha_{23}\\ \alpha_{31}&\alpha_{32}&\alpha_{33}\end{bmatrix} \left[ \begin{array}{c}u\\ v\\ 1\end{array} \right] \tag{5}\]  
where \(\textbf{{M}}\) is the perspective transformation matrix. The pixel coordinates of the image after perspective transformation are calculated as Equation (6). \[ \begin{cases}x=\left(\alpha_{11}\times u+\alpha_{12}\times v+\alpha_{13} \right)/\big{(}\alpha_{31}\times u+\alpha_{32}\times v+\alpha_{33}\big{)}\\ y=\left(\alpha_{21}\times u+\alpha_{22}\times v+\alpha_{23}\right)/\big{(} \alpha_{31}\times u+\alpha_{32}\times v+\alpha_{33}\big{)}\end{cases}  \tag{6}\]  
Figure 1: (**a**) Physical Image of wheel sinkage; (**b**) calculation model for wheel sinkage. Since the perspective transformation matrix has 8 degrees of freedom, \(\mathbf{M}\) can be obtained by providing the original pixel coordinates of the four points on the wheel surface and the corresponding pixel coordinates after perspective transformation. Canny edge detection is performed on the image to obtain pixel information at the wheel-terrain boundary. The image is first converted to the grayscale image, and Gaussian filtered using the Gaussian kernel in Equation (7). \[\mathbf{G}= \begin{bmatrix}1/16&2/16&1/16\\ 2/16&4/16&2/16\\ 1/16&2/16&1/16\end{bmatrix}  \tag{7}\]  
Subsequently, the magnitude and direction of the gradient are computed using the Sobel operator. Assuming that \(H_{(i,j)}\) is the pixel point to be computed, the gradients in the \(x\)-direction and \(y\)-direction are, respectively, expressed as  
\[\left\{ \begin{aligned} G_{x}=\begin{bmatrix}-1&0&1\\ -2&0&2\\ -1&0&1\end{bmatrix}\times\begin{bmatrix}A_{(i-1,j-1)}&A_{(i-1,j)}&A_{(i-1,j+1)} \\ A_{(i,j-1)}&H_{(i,j)}&A_{(i,j+1)}\\ A_{(i+1,j-1)}&A_{(i+1,j)}&A_{(i+1,j+1)}\end{bmatrix}\\ G_{y}=\begin{bmatrix}-1&-2&-1\\ 0&0&0\\ 1&2&1\end{bmatrix}\times\begin{bmatrix}A_{(i-1,j-1)}&A_{(i-1,j)}&A_{(i-1,j+1)} \\ A_{(i,j-1)}&H_{(i,j)}&A_{(i,j+1)}\\ A_{(i+1,j-1)}&A_{(i+1,j)}&A_{(i+1,j+1)}\end{bmatrix}\end{aligned} \right. \tag{8}\]  
where \(A_{(i-1,j-1)}\dots A_{(i+1,j+1)}\) represent the pixel value around point \(H_{(i,j)}\). Thus, the gradient strength \(G_{H}\) and gradient direction \(\theta_{H}\) at point \(H_{(i,j)}\) can be expressed as  
\[\left\{ \begin{aligned} G_{H}&=\sqrt{{G_{x}}^{2}+{G_{y}}^{2}}\\ \theta_{H}&=\arctan\Bigl{(}\frac{G_{y}}{G_{x}}\Bigr{)}\end{aligned} \right. \tag{9}\]  
Finally, the edge image is obtained by non-maximum suppression and hysteresis thresholding. Fitting the pixels at the wheel-terrain boundary is based on the least squares method. Combined with Equation (3), the pixels at the wheel-terrain boundary are fitted by  
\[ \begin{bmatrix}a\\ b\end{bmatrix} =( \begin{bmatrix}x_{1}&\cdots&x_{n}\\ 1&\cdots&1\end{bmatrix}\begin{bmatrix}x_{1}&1\\ \vdots&\vdots\\ x_{n}&1\end{bmatrix} )^{-1} \begin{bmatrix}x_{1}&\cdots&x_{n}\\ 1&\cdots&1\end{bmatrix}\begin{bmatrix}y_{1}\\ \vdots\\ y_{n}\end{bmatrix}  \tag{10}\]  
where \((x_{1},y_{1})\dots(x_{n},y_{n})\) represent coordinates of the wheel-terrain boundary points extracted from Canny edge detection. The wheel-terrain boundary (WTB) can be obtained from Equations (3) and (10).