| Brassica is suitable for widespread cultivation in the Ningxia region and is an important cash crop.In recent years,as the demand for yellow cauliflower has increased,production has also risen,and manual picking alone is time-consuming and labour-intensive.With high labour costs and low picking efficiency,it is therefore important to study an automatic picking device for the widespread development of the yellow cauliflower industry.Based on this,this paper uses the YOLOv7 target detection algorithm for intelligent recognition of yellow cauliflower,proposes an improved YOLOv7 detection algorithm for the large number of YOLOv7 parameters,and combines visual positioning technology to perform a ranging study of mature yellow cauliflower,outputting the real-world coordinates of yellow cauliflower and detecting the real-time distance from yellow cauliflower to the binocular lens.The specific work focuses on the following points:(1)Detection of mature yellow cabbage based on the YOLOv7 algorithm.The mosaic method was used to enhance the sample image data,the LabelImg software was used to annotate the images,and a weight file was trained based on the YOLOv7 algorithm to detect ripe yellow cabbage,and the training results were verified.The results show that the recognition rate can reach up to 91%for unobstructed mature yellow cabbage and up to 89%for obscured mature yellow cabbage.(2)Improvement of the network structure of the YOLOv7 algorithm.To address the problem that the original YOLOv7 model has a large number of parameters and cannot be ported to the embedded device side,this paper uses a lightweight ghostnet to replace the original YOLOv7 backbone neural network to achieve feature extraction and reduce the parameters of the network model;to address the problem that the accuracy of adding a lightweight network model is reduced,a CA attention mechanism is added to enhance the weight of important information in the feature map and suppress the weight of non-The accuracy of the model is improved by adding a CA attention mechanism to increase the weight of important information in the feature map and suppress the weight of non-relevant information.The experimental results show that the size of the improved YOLOv7 network model proposed in this paper is reduced from 74.8MB to 43.99MB,a reduction of 41.19%,but the accuracy of the model only decreases by 0.2%,which is fully portable to implement target detection in embedded devices.(3)The binocular ranging algorithm is added to the improved YOLOv7 network.Monocular ranging is simple in structure and fast in operation,but low in accuracy.In this paper,we adopt a binocular ranging algorithm that simulates the human eye,use Zhang’s calibration method to calibrate the camera,obtain the internal and external parameters of the camera,and achieve the search efficiency and matching accuracy of the corresponding pixel points of the image through stereo correction and stereo matching to obtain the parallax of the target object,and use binocular vision technology to detect the physical position of the yellow flowering plants in real time,so as to accurately measure the distance between the yellow flowering plants and the camera.The results show that the error of the distance measurement algorithm is within 2cm,which meets the basic conditions for intelligent picking by mobile robots.The experimental results show that the recognition and localisation algorithm of yellow cauliflower based on binocular vision proposed in this paper has a high detection accuracy and can meet the recognition needs of picking machinery for mature yellow cauliflower,proving the feasibility of the robot instead of human picking solution for yellow cauliflower,providing a theoretical basis and technical support for later implanting the algorithm into the robot arm or robot. |