# Research on Global Navigation Operations for Rotary Burying of Stubbles Based on Machine Vision
## 2 Materials and Methods
### Design of Starting Route Extraction Method  
In order to obtain the boundary information, this paper first extracts the edge information of the binarized image after morphological filtering, as shown in Figure 12, which completely retains the boundary information of the region. From the figure, it can be seen that there is interference edge information in the image that has nothing to do with the target region; in order to remove the interference of these error messages, this paper extracts the 100 pixels \(\times\) 120 pixels part of the bottom center of the image with more boundary information as the interval of interest and uses it to make the key information region of the start route extraction. Figure 11: Morphological operations: (**a**) open operation; (**b**) closed operation. Figure 12: Area of interest selection. then for each target point (\(x_{i},y_{i}\)) in the image coordinates, it is substituted into Equation (4) as follows to derive the possible values of the intercept of the possible line segments. \[b=-x_{i}\;a+y_{i} \tag{4}\]  
For every slope and intercept value that agrees with the elements of array A(\(a\), \(b\)), the corresponding array value is increased by 1, i.e., A(\(a\), \(b\)) = A(\(a\), \(b\)) + 1. After all the operations are completed, the largest peak value of A(\(a\), \(b\)) is found in the result of the parameter computation vote, and the corresponding a0 and b0 values are the slopes and intercepts of line equations for the line segments with the most covariant target points (a total of A(\(a\), \(b\)) covariant points) in the original image. Other sub-peak points correspond to the slope and intercepts of line segments with slightly fewer covariant points in the original image's intercept; the other sub-peak points correspond to the slopes and intercepts of the line segments with slightly fewer co-linear points in the original image. The final partial Hough matrix obtained after accumulation is shown in Figure 15.  
After the peak is identified, the values of the other elements in the neighborhood are set to 0 in order to remove other interfering points and duplicate points near the key peak. The peaks, which are smaller than half of the maximum peak, were removed, and only the key feature points were retained, ultimately leaving the coordinate points marked with a yellow \"\" as shown in Figure 16. Through the Hough matrix, the field boundaries are screened for peaks, and some of the peaks that have a greater impact on the acquisition of the starting route are retained. This method not only retains the basic features of the field boundaries but also reduces the number of feature points so that the running speed of the program is improved while ensuring the accuracy of the starting route. Figure 15: Hough matrix with 467–532 rows and 77–104 columns. In order to address the impact caused by the disorderly edges of the field, this paper introduces the Random Sampling Consensus Algorithm (RANSAC) to determine the boundary starting route equation. RANSAC mainly searches for the optimal straight line through randomness and assumptions. Firstly, a preset result is obtained through random sampling, and then the satisfaction of this preset result is obtained by comparing it with the hypothesis. Finally, the optimal linear equation with a higher proportion of correct data is obtained iteratively based on the law of large numbers. In this study, the probability of a union within the entire fitted line dataset is assumed, and its calculation formula is shown in Equation (5) below:  
\[\left\{ \begin{array}{l}t=\frac{n_{\text{inliers}}}{n_{\text{inliers}}+n_{ \text{outliers}}}\\ P=1-(1-t^{n})^{m}\\ m=\frac{\log(1-P)}{\log(1-t^{n})}\end{array} \right.