| Walnut is one of the world’s ‘four big dried fruit’,with high nutritional value,is a widely planted cash crop at home and abroad,walnut planting area and yield are ranked first in the world.Although walnut production in China is large,but in the export of foreign exchange is far behind the United States and other developed countries.In order to improve the quality and value of walnut in China,this thesis took walnut as the research object and established a detection and discrimination model based on computer vision technology and X-ray imaging technology,providing a theoretical support for the research and development of walnut online detection equipment.The main research contents and conclusions are as follows:(1)Walnut varieties were discriminated based on computer vision technology.Three kinds of sample images were collected by computer vision image acquisition system,and the images were preprocessed by3×3 template median filtering and neighborhood sharpening.The mean and variance of R,G,B,H,S,I,L~*,a~*,b~* of the 9 color components of each sample image were extracted,and a total of 18 color feature parameters were obtained.Gray co-occurrence matrix method(GLCM)was used to extract 20 texture feature parameters including energy,entropy,moment of inertia,correlation and deficit distance from each sample image in four directions(0°,45°,90°,135°).By comparing the classification results of different feature fusion,the model based on color features and texture feature parameters has the highest discrimination accuracy of98.78% for the three types of samples.The 12,15 and 13 feature parameters were optimized by competitive adaptive reweighted sampling(CARS),regression coefficient method(RC)and successive projections algorithm(SPA),respectively,and were used as inputs to establish the least squares support vector machine(LS-SVM)and partial least squares(PLS)discriminant models.The results showed that the discrimination accuracy of LS-SVM and PLS models based on SPA was the highest,which were 99.39% and 98.78%respectively.Considering that the running time of PLS model was shorter than that of LS-SVM model,the optimal characteristic parameters of SPA were finally selected in this study,and the PLS model was used to discriminate walnut varieties.(2)Hollow walnut was detected based on X-ray imaging technology.Sample images were collected by X-ray imaging equipment and preprocessed.In order to compare the classification results of normal walnut and empty walnut by different texture feature extraction methods,Characteristic parameters were extracted based on gray level co-occurrence matrix texture characteristic parameters(20),based on gray level cooccurrence matrix + gray difference statistical(23)to extract the texture feature parameters,based on gray level co-occurrence matrix + gray difference statistical + Tamura characteristic parameters(26)to extract the texture feature parameters,based on gray level co-occurrence matrix + gray difference statistics + Tamura +gray co-occurrence matrix extracted texture feature parameters(40 feature parameters)as input,and established partial least squares(PLS)and extreme learning machine(ELM)discriminant models.The discriminant accuracy of the two models based on gray co-occurrence matrix + gray difference statistics was100%.The speed of walnut conveying mechanism was set to 0.17m/s,0.25m/s,0.33m/s and 0.42m/s.The texture characteristic parameters of normal walnut and empty walnut at corresponding speed were extracted based on gray co-occurrence matrix + gray difference statistics.PLS and ELM discriminant models were established.The results show that the accuracy of the two models with the speed of 0.17m/s and 0.33m/s is higher than 97%,which meets the requirements.Considering the sorting efficiency,the best speed of walnut conveying mechanism is 0.33m/s.(3)Walnut size classification and system development based on computer vision technology.A computer vision image acquisition system was used to collect sample images,and the images were preprocessed.Morphology and logic operation were combined to obtain the number of projected area pixels of samples,and the minimum peripheral rectangle method was used to obtain the number of long pixels of samples.The linear model y=0.0028x-5.3154 and the fitting degree R2=0.87 were obtained by fitting the relationship between the number of pixels in the projected area of the sample and the measured weight.The linear model y=0.4483x+1.2055 and the fitting degree R2=0.9691 were obtained by fitting the relationship between the number of pixels in the sample and the measured transverse diameter.The two linear models can be used to predict the weight and diameter of walnut samples accurately.According to the physical index of walnut grading standard and the basic characteristics of ‘Gift No.2’ walnut,the size grading standard of ‘Gift No.2’ walnut was established.Based on the above theory,the walnut size classification system was developed by combining Lab VIEW and MATLAB,and 190 hand-sorted ‘Gift No.2’ walnuts were selected to test the system.The results showed that the comprehensive classification accuracy of the system was 93.16%,meeting the requirements of classification. |