为了满足现代农业精准施药技术中导航路径识别的需要,该文提出一种基于最大正方形的玉米作物行骨架提取算法。首先对采集到的田间玉米作物行图像进行灰度变换,采用改进的过绿灰度化算法使作物行与背景明显分割开来;然后通过滤波、阈值分割得到二值图像;而后对经过预处理后的二值图像进行形态学中的闭运算操作,得到玉米作物行的轮廓;最后利用最大正方形准则提取玉米作物行骨架。为了验证该算法的准确度,对提取的玉米作物行骨架进行直线拟合操作,利用拟合出的中央作物行线与实际导航线偏差的大小来判断骨架提取的精准度。试验结果表明,该算法能保持骨架像素的单一性,对边缘噪声具有很强的抗干扰能力,提取骨架的误差小于5 mm,能够满足玉米对行精准施药的需求。
To overcome the shortages of the existing methods for skeleton lines detection such as low adaptability and meet the needs of recognition for navigation path in modern precision spraying technology system, a new algorithm of skeleton lines detection was proposed based on maximum square principle in this paper. In the first part, pretreatment operation was applied to process the corn crop rows image. Firstly, the improved super green gray transformation algorithm (1.68G-R-B) was used to transfer the corn crop rows color image into gray-scale image and the corn crop rows was separated from the background for the first time. Compared with the traditional gray-scale methods, the improved algorithm in this article not only distinguished the crop rows and background better but also greatly reduced the noise interference and the processing time. Secondly, in order to split the crop rows more clearly, the middle filter operation was used to eliminate background noise. Thirdly, threshold segmentation method was used to convert gray-scale image into a binary image so to prominent the crop rows area further and extinction the background area, and the crop rows and the background were completely separated by the threshold segmentation. In the second part, the corrosion and expansion operation of morphological algorithm were used to process the above binary image. The 3×3 template element of corrosion was selected to eliminate the background noise that was smaller than the area of crop rows after binarization. The 5×1 template elements of expansion were selected to connect the discontinuous area goodly. In order to get the best contour of the corn crop rows, the times of corrosion and expansion operation was determined by experiment. In the third part, the skeleton of corn crop rows was extracted by maximum square principle that was put forward by this paper. Firstly, the region of crop rows was divided base on symmetry. Secondly, the number of pixels that the value was one in the maximum square of the undetermined skeleton