## 4 Positioning Method of Supported Anchor Rod in Roadway
### Supported Anchor-Rod Data Processing  
The positioning of the supported anchor rod must ensure that the depth map contains effective information of the target point to obtain the depth value. However, in collecting the depth image, some information is in the depth. The image will inevitably be missing due to noise interference. As shown in Figure 10, the black area in the picture is the information loss caused by the depth map noise. Therefore, the depth image needs to be denoised after the depth map is aligned with the RGB image. Extracting a two-dimensional region of interest (ROI) combined with a median and bilateral filtering method is used to denoise the depth map of the supported anchor rod. The main process of the data-processing method is as follows. (1) The improved YOLOv7 model recognizes the RGB image to obtain the anchor-rod detection boxes. The detection boxes are used as the ROI, and the corresponding area of the aligned depth map is extracted to reduce the unnecessary calculation;  
(2) The median filtering method is used to denoise the image region in ROI. The median filtering traverses the pixel values of each pixel in the area and its adjacent pixels. After sorting, the pixel value in the middle position is used as the pixel value of the current pixel to eliminate noise [31]. Because the depth value of each pixel in the ROI of the depth map is similar, and the depth value of the noise point is quite different, the noise is filtered  
Figure 10: Depth map denoising effect. The black box in the figure is ROI. Figure 9: Depth map alignment effect. by the median filtering method. As shown in Figure 10, the black area in the image is significantly reduced, but there is still interference;  
(3) Therefore, bilateral filtering is used for further denoising to retain the edge information of the image better while filtering out the noise. The bilateral filtering formula can be expressed as:  
\[I_{filtered}(x,y)=\frac{1}{W_{P}(x,y)}\sum_{(i,j)\in\Omega} \begin{array}{c}I(x +i,y+i)\cdot F_{spatial}(i,j)\\ \cdot F_{range}(I(x,y),I(x+i,y+i))\end{array}  \tag{10}\]  
where \(I_{filtered}(x,y)\) is the pixel value after filtering, \(I(x,y)\) is the pixel value in the original image, \(W_{P}(x,y)\) is the normalized weight, \(\Omega\) is the neighborhood window of the filter, \(F_{spatial}(i,j)\) is the spatial domain kernel function, and \(F_{range}I(x,y)\) is the pixel value domain kernel function. As shown in Figure 10, the black area disappears completely, and the target point can be further extracted for anchor-rod positioning. Through the YOLOv7 model, the size and position coordinates of the detection frame are obtained, and the center point of the anchor detection frame is used as the target point to realize the positioning of the anchor rod. When the drill-anchor robot moves forward along the roadway, the multivision sensor is located at the top of the fuselage to shoot the side plate, and the depth image is used to calculate the depth information. The installation position of the multivision sensor is known, and the anchor-rod row spacing and bolt spacing in each row of anchor rods are relatively fixed. However, due to the nonuniform speed of the drill-anchor robot and the calculation error in the coordinate conversion process, we use the least square method to perform linear fitting on each row of anchor rods on the side plate to reduce the positioning error in the \(X\)-axis direction of the camera coordinate system and correct the coordinate value. The positioning model is shown in Figure 11. In the figure, L is the distance between the multivision sensor and the sidewall plate. For the side-plate anchor rods, the coordinates in the \(Z\)-axis direction can be ignored, and only the coordinate information of the X and Y axes can be linearly fitted. The fitting line is required to be perpendicular to the \(X\)-axis to obtain the corrected coordinates. However, the least square method is unsuitable for fitting a straight line perpendicular to the \(X\)-axis.