Grape size detection and online gradation based on machine vision

Wang Qiaohua, Tang Yihua, Xiao Zhuang


This research investigated the size detecting and online grading of Red Globe grapes using images of entire cases, rather than individual grapes. Method of ellipse fitting based on iterative least median squares was proposed and the process of grape grading includes the following four steps: stem removal from the RGB and NIR images collected by the 2-CCD camera; edge extraction by multiple methods of edge detection, image binarization, morphological processing, et al.; size determination of individual grapes by using image segmentation and ellipse fitting to calculate short axis length; Finally, grading based on the 15% downgrade principle, this means that if the case contains more than 15% of multiple grades, then the case is re-evaluated. Thirty-eight cases of Red Globe grapes were graded using these methods and 35 cases were correctly graded with an accuracy rate reaching 92.1%. The results showed that the accuracy and speed meet the requirements of grape automatic online detection.
Keywords: machine vision, Red Globe grape, iterative least median squares, ellipse fitting, gradation
DOI: 10.3965/j.ijabe.20171001.2517

Citation: Wang Q H, Tang Y H, Xiao Z. Grape size detection and online gradation based on machine vision. Int J Agric & Biol Eng, 2017; 10(1): 226–233.


machine vision, Red Globe grape, iterative least median squares, ellipse fitting, gradation


Feng B, Wang M H. Detecting method of fruit size based on computer vision. Transactions of the CSAM, 2003; 43(1): 73–75. (in Chinese)

Wang Q H, Wen Y X, Lin X D. Correlation between egg freshness and morphological characteristics of light transmission image of eggs. Transactions of the CSAE, 2008; 24(3): 83–187. (in Chinese)

Zhou P, Liu J Y, Wang Q H. Egg image detection method and weight prediction model. Transactions of the CSAM, 2007; 38(11): 81–83. (in Chinese)

Ling Y. Study on grain appearance quality inspection using machine vision. Master dissertation, China Agricultural University, Beijing, 2004. (in Chinese)

Chen H, Xia Q, Zuo T. Determination of shiitake mushroom grading based on machine vision. Transactions of the CSAM, 2014; 45(1): 281–287. (in Chinese)

Deng H X. Research on the detection method of eggs’ size based on machine vision. Master dissertation,, Huazhong Agricultural University, Wuhan, 2006. (in Chinese)

Chen, Y, Li W, Zhang J X. Overlapped grapes berry size inspection based on image contour analysis. Transactions of the CSAM, 2011; 42(8): 168–172. (in Chinese)

Chen Y, Liao T, Lin C K. Grape inspection and grading system based on computer vision. Transactions of the CSAM, 2010; 41(3): 169–172. (in Chinese)

Zeng Q B, Liu C L, Miao Y B, Wang S P, Huang D F. Non-destructive measurement of diameter of overlapping grape fruit based on morphological image processing. Transactions of the CSAE, 2009; 25(9): 356–360. (in Chinese)

Wang Q H, Ding Y C, Luo J. Automatic grading device for Red Globe grapes based on machine vision and method there of CN102680414A. 2012-09-19. (in Chinese)

Blanc P. Unit for sorting and packing products capable of being hung on a hooking member for the purpose of their conveyance, such as bunches of fruits, in particular table grapes or truss tomatoes: US, 6957940. 2005-10-25. (USP)

Cubero S, Diago M P, Blasco J, Tardáguila J, Millán B, Aleixos N. A new method for pedicel/peduncle detection and size assessment of grapevine berries and other fruits by image analysis. Biosystems Engineering, 2014; 117(1): 62–72.

Roscher R, Herzog K, Kunkel A, Kicherer A, Pfer R, Rstner W. Automated image analysis framework for high-throughput determination of grapevine berry sizes using conditional random fields. Computers & Electronics in Agriculture, 2014; 100(1): 148–158.

Li M. Grape grain size non-destruction detection based on machine vision. Master dissertation, Huazhong Agricultural University, Wuhan, 2013. (in Chinese)

Xia J. A comparative study of ellipses fitting methods. Master dissertation, Jinan University, Guangzhou, 2007. (in Chinese)

Li Z Q, Teng H F. Generalized Hough transform: fast randomized multi-circle detection. Journal of Computer- Aided Design & Computer Graphics, 2006; 18(1): 27–33. (in Chinese)

Wang Z B, Wang K Y, Zhang S F, Liu Z Q, Ma C X. Whiteflies counting with κ-means clustering and ellipse fitting. Transactions of the CSAE, 2014; 30(1): 105–112. (in Chinese)

Andrew F, Maurizio P, Robert B. Fisher direct least square fitting of ellipses. IEEE Transaction on Pattern Analysis and Machine Intelligence, 1999; 21(5): 476–480.

Chien C F, Cheng Y C, Lin T T. Robust ellipse detection based on hierarchical image pyramid and Hough transform. Journal of the Optical Society of America A, 2011; 28(4): 581–589. (in Chinese)

Chaudhuri D. A simple least squares method for fitting of ellipses and circles depends on border points of a two-tone image and their 3-D extensions. Pattern Recognition Letters. 2010; 31 (9): 818–829.

Full Text: PDF

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.