Automatic navigation of agricultural machinery is an important part of precision agriculture and intelligent agriculture.Intelligent navigation based on machine vision will be a mainstream direction in the future.In the agricultural machine vision navigation system,it is very important to detect the navigation line accurately.This paper makes a preliminary study on the extraction of agricultural machinery navigation line based on machine vision.Firstly,preprocessing the farmland image captured by agricultural camera in RGB color space,then filling the hole and extracting ROI.Finally,according to the characteristics of farmland image,three different methods of feature points extraction and navigation line fitting are proposed.The main contents of this paper are as follows:(1)Preprocessing of farmland image.By analyzing and comparing the effects of different gray-scale algorithm,threshold segmentation algorithm and morphological filtering algorithm on RGB farmland image processing,a suitable farmland image preprocessing method is selected.(2)Hole filling and ROI creation.All foreground and background holes of pre-processed binary image is filled by morphological method.According to the characteristics of navigation path in farmland image,the trapezoidal ROI is created to reduce interference and improve the efficiency of subsequent detection.(3)Feature points extraction and navigation line fitting based on crop row edge.By analyzing and comparing the edge detection principle of different edge detection operators and the effect of crop line edge detection on farmland binary images,the appropriate edge detection operator is selected to detect crop line edge.ROI is extracted to reduce the number of edge points to be processed.Then,all edge coordinate neutrals are calculated every few rows as navigation feature points,and finally the navigation line is fitted by the least square method.(4)Feature points extraction and navigation line fitting based on midpoint of background pixel coordinates.Extracting the midpoint of the vertical coordinates of each row of background pixels in the image as the initial feature points.Then,image is segmented horizontally and the center of gravity of each horizontal bar is calculated.Finally the navigation line is fitted by the least square method.(5)According to the characteristic that the navigation path usually corresponds to the largest connected area in the farmland image,firstly the largest connected area in ROI is extracted as the navigation path,then the image is segmented horizontally and the center of gravity of each horizontal bar is calculated.Finally,the center of gravity is used as the navigation feature point to fit the navigation line by the least square method.Among the three feature points extraction and navigation line fitting algorithms proposed in this paper,the algorithm based on edge detection has relatively complex,the longest time-consuming,and the accuracy of the extracted navigation line is low;the algorithm based on background pixel midpoint detection has the lowest complexity,the shortest time-consuming,and the accuracy of the extracted navigation line is high;the algorithm based on maximum connected region detection has the best applicability.Its time-consuming is between the first two algorithms,and the accuracy of the extracted navigation line is the highest,which is almost the same as the result of manual extraction. |