Tomatoes are an important vegetable crop,and my country’s tomato planting area and total output both rank first in the world.For a long time,the inspection and grading of tomato quality in our country has mainly relied on manual completion.Manual grading is not only time-consuming and laborious,but also subjective.It cannot guarantee the accurate grading of tomatoes,nor can it conform to the smart agriculture of today’s society.development trend.In this regard,this paper proposes a tomato grading technology based on computer vision.This technology can be used in the tomato grading process to accurately extract the color,size,fruit shape,and defects of the tomato peel surface,and then pass the tomato grading process.The feature analysis of the surface image,the use of fuzzy theory to complete the comprehensive classification of tomatoes.First,image collection and sorting of tomatoes.Image preprocessing methods such as weighted average method,median filter method,and self-seeking optimal threshold method are used to perform gray-scale processing,denoising,segmentation and other work on the collected tomato images,which are used to remove the damage caused by the image acquisition process.The influence of factors such as the illumination,collection equipment,etc.And isolate the tomato image area,to prepare for the next work.Then extract the characteristics of tomatoes.In the tomato color feature extraction work,the RGB color model is used to extract the red and green related pixels on the surface of the tomato.The ratio of the red and green pixels is calculated and the maturity of the tomato is divided.In the extraction of tomato size feature,the experiment uses the smallest circumscribed circle method to extract its transverse diameter.Through calculation and analysis,the linear relationship between the pixel and the transverse diameter is established,and the tomato size parameter can be obtained.In the extraction of tomato fruit shape features,the roundness method is finally used to analyze the fruit shape features of tomatoes by comparing the aspect ratio method of the smallest circumscribed rectangle and the roundness method.In the tomato defect feature extraction work,the experiment uses convolutional neural network to detect tomato defects,and continuously improves and optimizes the network model structure according to the tomato defect characteristics,and finally determines the network model.The detection accuracy of the tomato defect can reach 98.91.%.Finally,the fuzzy theory is used to comprehensively classify tomatoes.Since the defects are not vague,the membership functions of maturity,size and fruit shape are finally determined through the analysis of the other three characteristics of tomatoes,and the weights of these three characteristics are determined in the form of questionnaires,using the weighted average model and The principle of maximum affiliation finally derives the quality grade of tomatoes.The experimental results show that using the method of grading tomato quality,the accuracy of identifying different grades is 100% for the first-class fruit,97.30% for the second-class fruit,97.14% for the third-class fruit,and 100% for the second-class fruit,has a higher accuracy rate than manual classification,which meets the classification requirements. |