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.