Abstract:
Abstract: There are color differences between different berries of a "Red Globe" cluster in the vineyard in the same period. This makes it inefficient and error-prone for visual maturity judgment of the grape cluster. As a result, inaccurate judgment often leads to grape harvesting too early or too late. Therefore, it is necessary to achieve accurate maturity discrimination of the grape cluster for increasing the quality grade and the commodity rate of the "Red Globe" grape. In this study, 79 images of the grape cluster in a grapery were acquired by the smartphone (HUAWEI Mate 10), including 59 images in natural light and 20 images in backlight. Firstly, the background of the grape cluster image was segmented using the K-Near Neighbor (KNN) algorithm and Otsu methods. For the KNN algorithm, 2 200 sets of R (Red), G (Green) and B (Blue) values were manually collected from the pixel of the image to be used as the data set. With the data set, different nearest numbers and the methods of distance calculation were tested to obtain a better background segmentation effect. For the Otsu method, the normalized color difference of (R-G) / (R+G) was applied as the background segmentation characteristic to reduce the influence of the lights on the R channel and G channel. For near red and green grape clusters under natural light and backlight, the background segmentation effect was compared using two algorithms. After labeling the images of grape clusters with the minimum bounding box, the Log operator was used to extract the edge of the first gradient image from the object region. Then, the Circle Hough Transform (CHT) method was applied to extract grape berries. The radius range of circle in the Hough transform was determined by measuring numbers of pixels of 60 grape berry images. In addition, we adjusted the values of the edge thresholds and sensitivities in Hough transform to obtain a higher accuracy of berry extraction. Meanwhile, the maturity of the grape berry was classified into four levels of G1, G2, G3, and G4 according to the H value of the pixels from the "Red Globe" grape image in the HSV space. Furthermore, the algorithm was developed to calculate the proportion of berries with different maturity grades in a cluster and classify the maturity degree of grape clusters. Finally, the classification performance for the grape cluster maturity with our developed algorithm was evaluated by the confusion matrix. The results showed that the KNN algorithm using Mahala Nobis distance obtained an accuracy of 93.25% and F1-score of 89.93% for background segmentation when the nearest number K was 5. While the accuracy and F1-score of background segmentation by the Otsu method were 87.78% and 79.44%, respectively. In comparison, the KNN method had a better segmentation effect regardless of the natural light, backlight or the green grape that were very similar to the background. In this case, the background segmented by the KNN algorithm was chosen for CHT extracting circle from the non-structured environment. The radius range of 23-72 pixels was determined for CHT to extract grape berries and the accuracy of grape berry extraction was up to 96.56% at high computation speed when the edge threshold and sensitivity were 0.15 and 0.942, respectively. Consequently, with our developed algorithm adopted, the maturity discrimination accuracy of the grape cluster was up to 91.14% compared with judgments from viticulturists. Moreover, the validation results proved that our proposed approach could discriminate against the slight change of maturity degree during the shorter growth period of the grape cluster. Thus, our research could guide for grape growers to select an appropriate harvest period. Also, it is useful for the research and development of automatic grape picking equipment in the future.