Abstract:
Abstract: Machine vision has been applied in automatic grading for fruit recently. It is well known that as an important detection task, online fruit grading automation faces some challenges in online sorting system. Machine vision is a developing technique facilitating the fruit detection. In this paper, in order to improve the accuracy and efficiency for apple grading, an online detection method of apple grading based on machine vision features is presented. Apple images can be captured from the online industrial camera in the sorting system, which can ensure that the imaging view is suitable for the object area of the conveyor. At first, to obtain the relationship between the real size and the image size, the improved calibration algorithm with the standard workpiece is used to calculate the pixel equivalent of the captured image. The distance regularized level set method is introduced to segment the workpiece edge, and the best-fit rectangle method is used to compute the length and width of the pixels. Then the values of pixel equivalent in length and width are respectively obtained. Secondly, because apple grading detections are mostly performed in indoors, illumination can seriously affect the detection accuracy. For this problem mentioned above, the image preprocessing including wavelet compression and median filtering is introduced to reduce the size and overcome the noise which is from the image acquiring and transmission previously. Accordingly, the improved three-layer Canny edge detection algorithm is proposed to extract the apple contour for the online image which suffers from the uneven lighting. In this step, the 3 different thresholds and scales are considered. The morphological operation is used to close the edge. Thirdly, according to the characteristics of the appearance class of the Fuji apple, multi-feature parameters can be considered, which include fruit diameter, defeat area, color degree, fruit shape, texture features, color distribution parameters and so on. Decision tree is used to determine the candidate class with fruit diameter, defeat area and color degree features. In the meanwhile, to save the online computation time, the features set should be reduced. So kernel principal component analysis (KPCA) is used to reduce both nonlinearity and dimension for fruit shape, texture and color distribution features. Support vector machine (SVM) is introduced to classify apple grades with dimensionality reduction features. The parameters of SVM are selected with particle swarm optimization (PSO) method for the training set. Finally, decision fusion is used for the apple grading based on decision tree result and SVM model result. In the experimental case, the actual fruit diameters were measured with vernier caliper for 5 apples, and the machine vision method with pixel equivalent was also used for measuring the fruit diameters of the same apples. Measurement error was about 2.83%. Then 30 apples were selected for training SVM modeling, and 120 apples were used to test the proposed method. The results showed that the recognition accuracy based on the decision fusion of image features could reach 95%. The proposed model has good performance of accuracy and stability. So the proposed method is believed to be feasible for online grading of apples. It also provides a frame of reference for other types of fruits.