| Weeds are one of the biggest threats to maize growth and can cause great damage if not dealt with in the early stages of crop growth.Traditional large-scale spraying of herbicides cannot accurately spray weeds,which not only causes waste of herbicides but also easily causes environmental pollution.With the development of computer technology,agricultural production technology is moving in the direction of precision,and agricultural precision plant protection equipment has become a new development trend in weed control technology.Accurate and rapid detection of maize crop rows and weeds is the premise of precision agricultural decision-making and implementation,but in complex field environments such as light changes,weed appearance changes,leaf occlusion and crop row missing plants,crop row and inter-row weeds are detected Still a big challenge.In this study,weeds in seedling maize crop rows and rows in the natural environment are taken as the research object,and a machine vision-based weed detection algorithm in crop rows and rows is proposed to provide theoretical basis and technical support for agricultural precision plant protection equipment,to promote the development of precision agriculture.The main research contents of this study are as follows:(1)To carry out research on crop row and weed detection methods based on machine vision technology requires the production and preprocessing of data sets in the early stage.This study aimed at the lack of image data of crop rows and weeds between rows of maize at the seedling stage,and produced a crop row and weed Data set,and select the appropriate image preprocessing method according to the complex field environment.First,in order to adapt the machine vision system to the complex field environment,the camera on the unmanned vehicle collects the RGB image data of maize crop rows at the seedling stage under different lighting conditions from a 30° oblique direction.The 2G-R-B super green feature factor was selected to convert the RGB image to grayscale,and the maximum between-class variance method was used to convert the grayscale image into a binary image to reduce the influence of illumination factors on crop row segmentation.Analyze and denoise the noise and interference pixels in the binary image,select the median filter method to denoise the binary image,and remove the connected regions with a pixel area less than10,000 pixels in the binary image based on the image morphology processing method.In order to study the feature extraction ability of the weed detection model for field weeds,this paper uses four common weeds in the maize field in the natural environment to create a data set of weeds between rows of maize crops.The data collection is divided into 10 stages,with an interval of 3-5 days between each stage,and data of different time periods and different weathers are collected to verify the adaptability of the weed detection algorithm to the natural environment.Data enhancement and data labeling are performed on the collected weed data,and the weed data set is used as the network input of the target detection algorithm to provide data support for subsequent research.(2)A method for detecting seedling maize crop rows and navigation lines based on multiple regions of interest was proposed.According to the planting characteristics of the crops and the pixel vertical projection curve of the binary image,the binary image of the crop row is divided into 10 horizontal strips,and the local features in each horizontal strip are extracted and the images are spliced to reflect the global features.The threshold is set to eliminate the interference of residual noise,and the feature points of the crop row and the navigation line are determined by scanning the pixel vertical projection curve of the last horizontal strip,and the position of the initial region of interest is determined according to the trough of the crop projection curve.According to the fact that the crop row presents a trend of narrowing from the bottom to the top of the image,the initial region of interest is applied to the subsequent horizontal strips,and the method of determining the feature points of the crop row and the feature point of the navigation line is repeated,and according to the crop projection The trough of the curve identifies the location of the new region of interest.Based on the improved least square method,the feature points are fitted with a straight line,and the parameters of the fitted line are judged by the weighted sum of squares of the errors between the sample points and the actual points.According to the crop row image data set,the performance of crop row detection is studied,and different methods are used to detect crop row images under different lighting conditions.The experimental results show that the average error angle of the algorithm proposed in this paper is 1.52°,and the accuracy rate reaches 93.1%,the average running time is 302.3ms,and the effect is better than the Hough transform method and the least square method.(3)A method for detecting weeds between rows of maize crops at the seedling stage based on the YOLO v4-weeds lightweight model was proposed.A lightweight feature extraction unit is built by combining the residual structure with the attention mechanism,and a pyramid pooling structure combined with a dense connection structure is designed,and a multi-scale feature fusion module combined with a spatial attention mechanism is built to extract multiple the scale local feature information is fused with subsequent global features to obtain more complete image features.Implemented Faster-RCNN,SSD 300 and YOLO v3,YOLO v3-tiny and YOLO v4-tiny target detection models,and selected Res Net-50,VGG16 and Dark Net53,Dark Net19 and CSPDarknet53-tiny as the backbone network of the model respectively.Based on the crop row weeds dataset,different target detection models and the model proposed in this paper are trained,verified and tested to verify the weed detection ability of the algorithm in this paper in a complex environment.The results show that the m AP of the method proposed in this paper for the detection of maize seedlings and related weeds is 86.69%,which is better than other weed detection models,the detection speed is 57.33f/s,and the model size is 34.08 MB.In addition,comparing the detection performance of YOLO v4-weeds with YOLO v3,YOLO v3-tiny and YOLO v4-tiny models under different weather conditions,the results show that the detection m AP of the model proposed in this paper is respectively in sunny and rainy days.It is 1.3% and 0.4% higher than the YOLOv3 model with better detection effect. |