Walnut is loved by the majority of consumers with its rich nutritional value.In this paper,in view of the problems of low efficiency,intensity labor and the inconsistency quality duo to human subjective factors by walnut kernel artificial grading,taking the varieties of walnut in the market in Xinjiang as the experimental research object,studying on the automatic detection and grading of walnut kernel external quality(color and integrity)by the method of machine vision according to the walnut kernel grading standards,and establishing a dynamic grading device for air-blown walnut based on target tracking method,providing a reference for the automatic grading of walnut kernel.The main contents and conclusions of this paper are as follows:(1)Image acquisition,transportation and air-blown automatic grading experimental platform applicable for the walnut kernel is established.(2)Through the walnut RGB three-channel image analysis to determine the background color for walnut image segmentation is blue.(3)Enhance the differences between the foreground and background of walnut image by B-R channel subtraction,the foreground and background of the image are separated by a global binarization with a fixed threshold of 20.The image morphological method is used to filter out the noise and eliminate the target area hole to generate the contour mask of walnut kernel target.The background is removed in the original image and the walnut kernel target image is separated by the minimum circumscribed rectangle.(4)Taking each grade of 30 walnut kernel making up of 150 walnut samples.First,the color features based on the color histogram and the color moments are extracted,then the ratio of contour area to the smallest circumscribed circle area of the contour and the aspect ratio of smallest external rectangle are extracted to indicates completeness,all of them composition of the original feature sample set.(5)The Relief F algorithm used to filter the important features,and the m RMR algorithm of feature selection is used to sorting features according to the original feature sample set,which are used to training model by learning algorithm of SVM,Decision tree and Naive Bayesian.Finally,150 test samples were selected for grading test,and the maximum correct rate was 85.33%,96.00% and 97.33% respectively.(6)Walnut kernel automatic grading system interface software is designed based on Visual Studio and Open CV,which including image acquisition,motor control,sample collection,local testing and other functions.(7)A dynamic grading method of walnut kernel based on Cam Shift tracing algorithm is proposed.The single-chip controlled pneumatic valve is designed to complete the gas-blown grading method of walnut kernel.The randomly selected 20 walnuts were tested for grading speed,the grading speed is 4.4 / s.The naive Bayesian model is used for dynamic grading test,and its grading accuracy rate of 81.33%. |