The invention relates to a
ridge line navigation method and
system based on visual segmentation. The
ridge line navigation method and
system based on visual segmentation comprises the following steps: acquiring an original image, preprocessing the original image, and importing a YOLOv8 model for training to obtain a
ridge surface segmentation
mask;
edge detection is carried out on the ridge surface segmentation
mask, pixel point information of ridge
surface contour coordinates is determined, and central point pixel coordinates are obtained; fitting navigation lines for all the center points by adopting a B spline interpolation method, and drawing reference lines; and calculating the average absolute percentage error of each pixel point of the
reference line and the navigation line, confirming a deviation
signal, and judging the vehicle body adjustment direction through the deviation
signal. According to the scheme provided by the invention, the model can be trained through the complex environment image, the ridge surface segmentation
mask can be obtained through the YOLOv8 model, the field ridge contour boundary can be extracted, the navigation line can be fitted by adopting the B-spline interpolation method, the real-time
reference line can be set, the average absolute error of the navigation line and the
reference line can be calculated, the deflection
signal can be given, and more accurate deflection information can be provided.