基于HOG特征和SVM的棉花行数动态计数方法

    Method for dynamic counting of cotton rows based on HOG feature and SVM

    • 摘要: 正确地进行棉花行数的动态计数是保证视觉植保车在田端横移过程中实现准确定位的前提。该研究以植保期间的棉花作物为研究对象,提出通过方向梯度直方图(Histogram of Oriented Gradient,HOG)和支持向量机(Support Vector Machine,SVM)实现棉田的棉花行动态计数方法。为了减少棉花行之间的粘连,以及缺苗和倒伏对棉花行识别造成的影响,设置图像的感兴趣区域(Region of Interest,ROI);为了减小相机抖动、光照变化以及刮风对动态数行造成的影响,使用HOG-SVM模型在视频序列图像ROI区域内窗口滑动检测,将棉花行和行间背景分别设置正、负样本,通过提取二者HOG特征、多次训练获得SVM分类器参数,固化HOG-SVM模型,再使用非极大值抑制(Non-Maximum Suppression,NMS)进行窗口的归一,通过归一化互相关(Normalized Cross Correlation,NCC)模板匹配实现棉花行的动态跟踪和计数。结果表明,该方法可以准确地对棉花行实现动态计数,有很好的泛化能力,识别率高于90%,平均每帧检测时间为32 ms,满足实际田间作业要求,可作为视觉植保车在地头横移的距离依据。

       

      Abstract: The counting of cotton rows is dynamically a premise of accurate positioning of a visual plant protection vehicle, which can ensure that the vehicle can traverse at the end of a field. In this study, cotton during plant protection periods was taken as the research object, which presented a dynamic counting method of cotton rows based on Histogram of Oriented Gradient (HOG) and Support Vector Machine (SVM). Hogs of cotton rows and inter-row background were extracted as feature descriptors of images, then they were classified by an SVM classifier. In this way, cotton rows could be identified through classifying cotton rows and inter-row backgrounds. 7 000 positive and negative training samples were respectively prepared for HOG characteristics of training samples. Among them, positive samples contained a complete outline of cotton lines in width, by contrast, negative samples contained soil among lines, plastic films and incomplete outline of cotton lines, etc. Besides, 1 000 positive and negative test samples were prepared to optimize parameters of the HOG-SVM model. By setting a sliding window to training samples, hog features of sample images were extracted, meanwhile positive and negative samples were marked for initial training on SVM classifier parameters. The initially trained SVM classifier was used to classify and test the samples, and those with wrong classifications were picked out for re-marking and re-training. Such retraining processes would continue until all test samples were correctly classified. Then the final HOG-SVM model was solidified for video detections. In recognizing processes, the model was used to slide the window in sequence images and to detect. In the sequence images, the HOG-SVM model built in the previous step was used by the sliding window. In this way, cotton rows in the video could be detected. The same rows of cotton could be detected for many times. To accurately identify cotton rows, Non-Maximum Suppression (NMS) was used to normalize target windows of detected cotton rows. All candidate target windows were scored with confidence and sorted from high to low, then the one with the highest score was retained. In two consecutive images, NCC (Normalized Cross-Correlation) values of target windows of front and back frames were solved to match the same rows of cotton, realized dynamic tracking of cotton rows, and further realized counting. Visual perspectives would have different effects on the upper and lower ends of images. There was an adhesion among cotton rows at the upper end of images, and those at the lower end of images were lack of seedlings and lodging. Such interferences had impacts on identifications of cotton rows. To solve this problem, the Region of Interest (ROI) was set for video sequence images in this study, and recognition processes of all cotton rows were within the ROI region with a very complex cotton field environment. This method had strong robustness to change in a camera's view angles and natural environment, such as to change in the light as well as shook of branches and leaves caused by winds, etc. In this algorithm, the recognition rate of cotton rows was higher than 90% under the condition in which winds were lower than level-2 and the average detection time per frame was lower than 32 ms, which met requirements of actual field operations. This dynamic counting method of cotton rows was used as a basis for determining transverse distances of visual plant protection vehicles at field ends, which could be used in other semi-structured rows to plant low and short crops.

       

    /

    返回文章
    返回