| The robot operation production in greenhouse environment is the embodiment of agricultural automation and intelligence.At present,manual picking and inspection are the main production activities in greenhouse.The work efficiency of this method is low and the result deviation will be caused by subjective factors.The machine vision technology is used to detect and identify the fruit,maturity detection and fruit size detection,which reduces the human and material resources,but also reduces the harm of the personnel in and out of tomato growth,and greatly improves the working efficiency.Therefore,this paper studies the inspection and identification of greenhouse tomato fruit and its characteristics based on machine vision,which is based on the detection and identification of tomato,maturity,fruit location and size of tomato.In this paper,yoov4,mask r-cnn and other algorithms are used to identify,detect and locate tomatoes on the platform of inspection robot and picking robot.Firstly,the tomato fruit was identified,and the color features of the identified fruit were obtained.Combined with OpenCV and digital image processing,the appropriate color features were selected as the judgment basis of fruit maturity,and the fruit maturity was detected.In this paper,the location of ripe fruit by picking robot combined with depth information is studied.The inspection robot segmented the contour of the fruit,combined with the equipment point cloud,launched the fruit size detection research.It is mainly divided into the following parts.(1)Single tomato fruit recognition in Greenhouse:more than 200000 tomato fruit tracking pictures were taken,and 1005 suitable pictures were selected as the data set samples,and labeled and divided.Compared with SSD,yellov3 and yellov4 target detection algorithms,considering the detection speed,confidence,map and field recognition accuracy,the detection speed of yellov4 in greenhouse environment is 5-6 frames/s,the confidence is generally stable at 0.8,the map is 98.46%,and the field recognition rate is more than 96.13%.Finally,yellov4 is selected as the single fruit recognition algorithm.(2)Tomato fruit maturity detection:according to expert guidance and data tracking,standard color card to get the reference standard of fruit maturity.The inspection robot takes the results of single fruit recognition as the samples of fruit maturity analysis,and proposes pixel value accumulation to extract the color features of samples.According to the principle of color light tricolor,the proportion of R component in RGB space is used as the maturity judgment basis,and K-means clustering method is added to remove the background and noise.The maximum detection error of the test result is 6.16%,which meets the requirements of inspection robot.The picking robot only needs to recognize and detect the ripe and pluckable fruit.According to the analysis of color characteristics of mature fruit,the threshold of H component in HSV space was set to determine the mature fruit.Combined with K-means clustering background and noise removal,the mature fruit was obtained.Combined with depth information,the camera coordinates of the fruit were obtained and output orderly.Through the static and dynamic test experiments,the dynamic detection success rate is more than 79.31%,and the static detection success rate is more than 88.77%.It meets the requirements of picking robot recognition.(3)Research on fruit size detection method based on mask r-cnn:after the fruit is identified by yolov4 algorithm,the data samples are obtained.By comparing the segmentation effect of traditional method and instance segmentation algorithm,mask r-cnn is selected to segment the identified fruit semantically.The left and right critical edge points of the fruit are extracted and transformed into the camera coordinate system.The center point approximation method is proposed to solve the problem of pixel drift and holes of the edge points of the fruit,and the three-dimensional space coordinates of the edge points on both sides are obtained.Then the fruit size was calculated according to the distance between the points.The maximum relative error is 7.59%,the maximum absolute error is 3.59mm,the minimum relative error is 0%,and the average relative error is 2.29%.On this basis,according to the tracking of fruit growth cycle,the data of fruit growth time and size were obtained,and the least square method was used to fit the data to establish the fruit growth model.The current growth stage of tomato fruit was estimated by the detection value of tomato fruit size.The experiment shows that the predicted value has a certain reference value. |