China is a big country in apple production,but China’s apple export price is low,the reason for this result is that China lags behind international standards in apple grading technology.At present,China’s apple grading methods are mainly manual and mechanical,and there are many shortcomings in the two methods,such as low grading efficiency,unstable grading standards,and easy damage to apples.In order to improve the level of apple grading technology,an apple rapid grading system is designed in combination with machine vision technology.According to the actual needs of apple grading,the system designs the overall scheme of the system based on the size,shape,volume,weight and damage of apples.Compared with the traditional apple grading method,the accuracy and speed of grading are greatly improved.The main research work is as follows:First,the light source,camera and lens are selected,and then the Apple image acquisition system based on machine vision is established.The imaging distortion caused by the damage in the manufacturing process and the error of assembly of the optical imaging system is described,and the distortion is corrected by Zhang Zhengyou calibration method,and the camera internal and external parameter matrix is obtained,which is used to convert the pixel size of the apple image into the physical size.By studying the histograms of R,G and B components in different color backgrounds of apples,the most suitable white as the background for image acquisition was obtained.The Apple RGB color image was grayscaled,Gaussian filtering was used for smooth noise reduction,and the Canny edge operator was used to detect and extract the Apple edge according to the gradient information,which realized apple size measurement and edge extraction.In this paper,gradient direction information entropy,SVM support vector machine and deep learning YOLOv5 object detection were used to identify apple damage and compare the accuracy of the two methods,and finally the YOLOv5 model with better recognition effect was selected as the final damage detection method.According to GB/T10651-2008 "Fresh Apple",an apple grading model is created based on the size,shape,volume,weight and whether there is damage to complete apple grading.The results show that the error of apple volume and apple weight measured by the integral method is less than 2%,and the accuracy of machine vision apple grading is 96.35%,and the machine vision grading system meets the needs of apple grading. |