Multimedia Tools and Applications

, Volume 76, Issue 12, pp 14075–14089 | Cite as

Extracting the symmetry axes of partially occluded single apples in natural scene using convex hull theory and shape context algorithm

  • Leilei Niu
  • Weicong Zhou
  • Dandan Wang
  • Dongjian He
  • Haihui Zhang
  • Huaibo SongEmail author


Accurate identification of apples partially occluded by branches and leaves is an urgent and key issue for a picking robot. The objective of this study was to detect the symmetry axes of partially occluded single apples accurately using the convex hull theory and Shape Context algorithm. Firstly, apple regions were obtained by using K-means clustering algorithm. Secondly, image pre-processing steps such as image binarization, hole filling, area opening and edge detection were applied. Thirdly, false contours were removed based on the convex hull theory to enhance the accuracy and stability of this method. Finally, the point matching relationship of each two contours and the two best symmetrical contours were found by using the Shape Context algorithm and Hungarian algorithm. Then the symmetry axes of apples were extracted using the matching point pairs. Least squares ellipses fitting algorithm and moment of inertia algorithm were used to compare with the presented algorithm. The angle difference between extracted symmetry axis and ideal symmetry axis for every method was computed, and the execution time of program as well. Ninety partially occluded single apple images were tested. The experimental results showed that the average angle error of the Shape Context algorithm were 7.72°, 37.5 % of the ellipses fitting algorithm and 31.3 % of the inertia moment algorithm. And its average execution time is 1.86 s, 103 % of the ellipses fitting algorithm and 106 % of the inertia moment algorithm. In conclusion, it was feasible to use the proposed method to extract the symmetry axes of partially occluded apples.


Occluded apple Symmetric axis extraction Shape context Convex hull theory K-means clustering algorithm Threshold method 



This work is supported by the National High Technology Research and Development Program of China (863 Program) (No.2013AA10230402), Natural Science Basic Research Plan in Shaanxi Province of China (No. 2014JQ3094). The authors would like to thank all the authors cited in this article and anonymous referees for their helpful comments and suggestions.


  1. 1.
    Belongie S, Malik J, Puzicha J (2000) Shape Context: A new descriptor for shape matching and object recognition. In: Advances in Neural Information Processing Systems 13 I.E. 831–837Google Scholar
  2. 2.
    Bohg J, Kragic D (2010) Learning grasping points with shape context. Robot Auton Syst 58(4):362–377CrossRefGoogle Scholar
  3. 3.
    Fitzgibbon A, Pilu M, Fisher RB (1999) Direct least square fitting of ellipses. IEEE Trans Pattern Anal Mach Intell 21(5):476–480. doi: 10.1109/34.765658 CrossRefGoogle Scholar
  4. 4.
    Gu BX, Ji CY, Wang HQ, Tian GZ, Zhang GY, Wang L (2012) Design and experiment of intelligent mobile fruit picking robot. Trans Chin Soc Agri Machinery 43(6):153–160Google Scholar
  5. 5.
    Kuhn HW (1955) The Hungarian method for the assignment problem. Nav Res Logist 2(1–2):83–97. doi: 10.1002/nav.3800020109 MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Li HL, He DJ (2013) Study on technology of restore and location of apples under occluded. J Agri Mechanization Res 35(9):20–23MathSciNetGoogle Scholar
  7. 7.
    Li K, Lan WY (2011) Traffic indication symbols recognition with Shape Context. In: Computer Science & Education (ICCSE), 2011 6th International Conference on IEEE 852–855Google Scholar
  8. 8.
    Li CC, Wang B, Wang J, Li FG (2012a) Extracting vein of leaf image based on K-means clustering. Trans Chin Soc Agri Eng (Transactions of the CSAE) 28(17):157–162Google Scholar
  9. 9.
    Li Z, Hong TS, Zeng XY, Zheng JB (2012b) Citrus red mite image target identification based on K-means clustering. Trans Chin Soc Agric Eng (Transactions of the CSAE) 28(23):147–153Google Scholar
  10. 10.
    Liang N, Guo L, Yu Y (2009) A symmetry detected method based on the minimal value of moment of inertia. Microprocessors 30(6):62–64Google Scholar
  11. 11.
    Lin TC, Huang HC, Liao BY, Pan JS (2007) An optimized approach on applying genetic algorithm to adaptive cluster validity index. Int J Comput Sci Eng Sys 1(4):253–257zbMATHGoogle Scholar
  12. 12.
    Liu Z, Shen H, Feng GY, DW H (2012) Tracking objects using shape context matching. Neurocomputing 83:47–55CrossRefGoogle Scholar
  13. 13.
    Ma LL, Cheng C, Zhang SF, Wang JZ (2013) Gesture recognition based on improved shape context algorithm and Earth Mover’s Distance. In: Control Conference (CCC) IEEE 3906–3911Google Scholar
  14. 14.
    Mehta SS, Burks TF (2014) Vision-based control of robotic manipulator for citrus harvesting. Comput Electron Agric 102:146–158CrossRefGoogle Scholar
  15. 15.
    Premachandran V, Kakarala R (2013) Perceptually motivated shape context which uses shape interiors. Pattern Recogn 46(8):2092–2102CrossRefGoogle Scholar
  16. 16.
    Rakun J, Stajnko D, Zazula D (2011) Detecting fruits in natural scenes by using spatial-frequency based texture analysis and multiview geometry. Comput Electron Agric 76(1):80–88CrossRefGoogle Scholar
  17. 17.
    Shi SQ, Shi GM, Qi F (2011) Partially occluded object recognition algorithm based on feature description integrity. Syst Eng Electron 33(4):913–918MathSciNetzbMATHGoogle Scholar
  18. 18.
    Song HB, He DJ, Pan JP (2012) Recognition and localization methods of occluded apples based on convex hull theory. Trans Chin Soc Agric Eng (Transactions of the CSAE) 28(22):174–180Google Scholar
  19. 19.
    Wachs JP, Stern HI, Burks T, Alchanatis V (2010) Low and high-level visual feature-based apple detection from multi-modal images. Precis Agric 11(6):717–735CrossRefGoogle Scholar
  20. 20.
    Wang ZY, Lu B, Chi ZR, Feng DG (2011) Leaf image classification with shape context and SIFT descriptors. In: International Conference on Digital Image Computing Techniques and Applications IEEE 650–654Google Scholar
  21. 21.
    Wang DD, Song HB, Yu XL, Zhang WY, Qu WF, Xu Y (2015) An improved contour symmetry axes extraction algorithm and its application in the location of picking points of apples. Span J Agric Res 13(1):e0205. doi: 10.5424/sjar/2015131-6181 CrossRefGoogle Scholar
  22. 22.
    Whittaker AD, Miles GE, Mitchell OR, Gaultney LD (1987) Fruit location in a partially occluded image. Trans ASAE 30(3):591–596CrossRefGoogle Scholar
  23. 23.
    Wu YW, Li L, Zhang MJ (2013) Detection algorithm based on the shape context for cab duty officer. Electron Des Eng 21(14):26–29Google Scholar
  24. 24.
    Xie ZH, Ji CY, Guo XQ, Ren SG (2010) An object detection method for quasi-circular fruits based on improved Hough transform. Trans CSAE 26(7):157–162Google Scholar
  25. 25.
    Xun Y, Chen X, Li W, Liu G, Xu CG (2007) Automatic recognition of on-tree apples based on contour curvature. J Jiangsu Univ (Natural Science Edition) 28(6):461–464Google Scholar
  26. 26.
    Zhang XQ, Liu LN, Tang ZJ (2006) A convex hull algorithm based on convex polygon. Comput Sci 33(9):218–221Google Scholar
  27. 27.
    Zhang YY, Yang NQ, Li W, Wu XJ, Ruan QQ (2009) Gait recognition using Procrustes shape analysis and shape context. In: Comput Vision – ACCV 2009. Springer Berlin, Heidelberg, pp. 256–265Google Scholar
  28. 28.
    Zhao J, Tow J, Katupitiya J (2005) On-tree fruit recognition using texture properties and color data. In: Intelligent Robots and Systems 2005 (IROS 2005) IEEE, 263–268Google Scholar
  29. 29.
    Zhou QH (2007) On an isomorphic direction of improving and optimizing an algorithm for determining the convex hull of 2D point set or line segment set. Comput Sci 34(7):216–218,247Google Scholar

Copyright information

© Springer Science+Business Media New York 2016

Authors and Affiliations

  • Leilei Niu
    • 1
  • Weicong Zhou
    • 1
  • Dandan Wang
    • 1
  • Dongjian He
    • 1
  • Haihui Zhang
    • 1
  • Huaibo Song
    • 1
    Email author
  1. 1.College of Mechanical and Electronic EngineeringNorthwest A&F UniversityYanglingChina

Personalised recommendations