## 2 Methodology
### Relationship between the Prediction Box and the Belt Edge Line
Then, for Figure 2b, the coordinates of point \(g\), \((x_{g},y_{g})\), can be calculated using Equation (4), and the coordinates of point \(h\), \((x_{h},y_{h})\), can be calculated using Equation (5). The straight-line equation of the right belt edge can be expressed as Equation (6):  
\[x_{g}=x_{R}-\frac{w_{R}}{2}\ y_{g}=y_{R}-\frac{h_{R}}{2} \tag{4}\]  
\[x_{h}=x_{R}+\frac{w_{R}}{2}\ y_{h}=y_{R}+\frac{h_{R}}{2} \tag{5}\]  
\[\frac{y-y_{g}}{y_{h}-y_{g}}=\frac{x-x_{g}}{x_{h}-x_{g}} \tag{6}\]  
In the same way, if we assume that the coordinates of points \(e\) and \(f\) are \((x_{e},y_{e})\) and \((x_{f},y_{f})\), the linear equation of the left belt edge in the oblique shooting mode can be expressed as follows:  
\[\frac{y-y_{e}}{y_{f}-y_{e}}=\frac{x-x_{e}}{x_{f}-x_{e}} \tag{7}\]  
In contrast to vertical shooting, certain auxiliary and reference lines are required to determine the deviation state of a conveyor belt in a titled state, and the rules for determining the deviation state proposed in this paper can be found in \[x_{a}=x_{L}-\frac{w_{L}}{2}\ y_{a}=y_{L}-\frac{h_{L}}{2} \tag{1}\]0  
One should assume that there exists a horizontal virtual reference line at distance \(\Delta y\) from the \(x\)-axis that intersects the left boundary of the field of view at point \(L\), intersects the right boundary of the field of view at point \(R\), intersects the left belt edge at point \(M_{0}\), and intersects the right belt edge at point \(R\). Then, the distance b  
\[x_{a}=x_{L}-\frac{w_{L}}{2}\ y_{a}=y_{L}-\frac{h_{L}}{2} \tag{1}\]1 Schematic diagram of the calculation method for deviation: (**a**) general calculation rules, (**b**) method used in this paper. and the edges on both sides of the field of view can be represented by \(D_{LM_{0}}\) and \(D_{RN_{0}}\), respectively. The calculation method is shown in Equations (8) and (9):  
\[x_{a}=x_{L}-\frac{w_{L}}{2}\ y_{a}=y_{L}-\frac{h_{L}}{2} \tag{1}\]2  
\[x_{a}=x_{L}-\frac{w_{L}}{2}\ y_{a}=y_{L}-\frac{h_{L}}{2} \tag{1}\]3  
Further, the judgment of the deviation state of the belt can be realized by setting the deviation threshold \(\tau\), and the judgment rule can be found in Equation (10). The proposed linear equation-based deviation estimation method is suitable for both the belt overall deviation and belt inclination, as it takes the belt slope into account. \[if\bigg{\{} \begin{vmatrix}|D_{LM_{0}}-D_{RN_{0}}|>\tau&\text{deviation}\\ |D_{LM_{0}}-D_{RN_{0}}|\leq\tau&\text{normal}\end{vmatrix}  \tag{10}\]  
In this paper, the intersection of the belt edge's straight line and the camera's field of view is directly used as a reference, as shown in Figure 3b, which can also be understood as \(\Delta y=H\) in Equations (8)-(10). As for the setting of deviation threshold \(\tau\), we recommend the following two methods. (1) First, researchers should manually screen the conveyor belt deviation images in the dataset and then use the method proposed in this article to identify the conveyor belt edge in the screened image, calculate the deviation amount, set the calculation result as the threshold, and use this for subsequent automatic detection. (2) Researchers should randomly select an image in the dataset and then use the drawing tool to draw an inclined straight line parallel to the left/right edge. When assuming that the straight line is the left/right boundary of the conveyor belt, the drawing tool can be used to measure the distance (pixels) between the drawn straight line and the actual edge line of the conveyor belt on the horizontal virtual reference line. Then, the threshold can be calculated.