Springer Nature is making SARS-CoV-2 and COVID-19 research free. View research | View latest news | Sign up for updates

Toward reliable experiments on the performance of Connected Components Labeling algorithms

  • 118 Accesses

  • 6 Citations


The problem of labeling the connected components of a binary image is well defined, and several proposals have been presented in the past. Since an exact solution to the problem exists, algorithms mainly differ on their execution speed. In this paper, we propose and describe YACCLAB, Yet Another Connected Components Labeling Benchmark. Together with a rich and varied dataset, YACCLAB contains an open source platform to test new proposals and to compare them with publicly available competitors. Textual and graphical outputs are automatically generated for many kinds of tests, which analyze the methods from different perspectives. An extensive set of experiments among state-of-the-art techniques is reported and discussed.

This is a preview of subscription content, log in to check access.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7


  1. 1.


  2. 2.


  3. 3.

    After the appearance of the YACCLAB project results, OpenCV changed its default algorithm to the fastest one reported in YACCLAB.

  4. 4.

    SAUF and BBDT are the algorithms currently included in the OpenCV library (since version 3.2).


  1. 1.

    Agam, G., Argamon, S., Frieder, O., Grossman, D., Lewis, D.: The Complex Document Image Processing (CDIP) Test Collection Project. Illinois Institute of Technology, Chicago (2006)

  2. 2.

    Baltieri, D., Vezzani, R., Cucchiara, R.: 3DPeS: 3D people dataset for surveillance and forensics. In: Proceedings of the 2011 Joint ACM Workshop on Human Gesture and Behavior Understanding, ACM, pp. 59–64 (2011)

  3. 3.

    Bolelli, F.: Indexing of historical document images: ad hoc dewarping technique for handwritten text. In: 13th Italian Research Conference on Digital Libraries (2017)

  4. 4.

    Bolelli, F., Borghi, G., Grana, C.: Historical handwritten text images word spotting through sliding window hog features. In: 19th International Conference on Image Analysis and Processing (2017)

  5. 5.

    Bolelli, F., Borghi, G., Grana, C.: Xdocs: an application to index historical documents. In: Italian Research Conference on Digital Libraries. Springer, pp. 151–162 (2018)

  6. 6.

    Cabaret, L., Lacassagne, L., Etiemble, D.: Parallel light speed labeling: an efficient connected component algorithm for labeling and analysis on multi-core processors. J. Real Time Image Process (2016). https://doi.org/10.1007/s11554-016-0574-2

  7. 7.

    Chang, F., Chen, C.J., Lu, C.J.: A linear-time component-labeling algorithm using contour tracing technique. Comput. Vis. Image Underst. 93(2), 206–220 (2004)

  8. 8.

    Chang, W.Y., Chiu, C.C.: An efficient scan algorithm for block-based connected component labeling. In: 22nd Mediterranean Conference of Control and Automation (MED), IEEE, pp. 1008–1013 (2014)

  9. 9.

    Chang, W.Y., Chiu, C.C., Yang, J.H.: Block-based connected-component labeling algorithm using binary decision trees. Sensors 15(9), 23,763–23,787 (2015)

  10. 10.

    Di Stefano, L., Bulgarelli, A.: A simple and efficient connected components labeling algorithm. In: International Conference on Image Analysis and Processing, IEEE, pp. 322–327 (1999)

  11. 11.

    Dijkstra, E.W.: A Discipline of Programming/Edsger W. Dijkstra. Prentice-Hall, Englewood Cliffs (1976)

  12. 12.

    Dong, F., Irshad, H., Oh, E.Y., Lerwill, M.F., Brachtel, E.F., Jones, N.C., Knoblauch, N.W., Montaser-Kouhsari, L., Johnson, N.B., Rao, L.K., et al.: Computational pathology to discriminate benign from malignant intraductal proliferations of the breast. PLoS ONE 9(12), e114,885 (2014)

  13. 13.

    Grana, C., Borghesani, D., Cucchiara, R.: Optimized block-based connected components labeling with decision trees. IEEE Trans. Image Process. 19(6), 1596–1609 (2010)

  14. 14.

    Grana, C., Montangero, M., Borghesani, D.: Optimal decision trees for local image processing algorithms. Pattern Recogn. Lett. 33(16), 2302–2310 (2012)

  15. 15.

    Grana, C., Baraldi, L., Bolelli, F.: Optimized connected components labeling with pixel prediction. In: Advanced Concepts for Intelligent Vision Systems (2016)

  16. 16.

    He, L., Chao, Y., Suzuki, K.: A linear-time two-scan labeling algorithm. In: International Conference on Image Processing, vol. 5, pp. 241–244 (2007)

  17. 17.

    He, L., Chao, Y., Suzuki, K.: A run-based two-scan labeling algorithm. IEEE Trans. Image Process. 17(5), 749–756 (2008)

  18. 18.

    He, L., Chao, Y., Suzuki, K., Wu, K.: Fast connected-component labeling. Pattern Recogn. 42(9), 1977–1987 (2009)

  19. 19.

    He, L., Zhao, X., Chao, Y., Suzuki, K.: Configuration-transition-based connected-component labeling. IEEE Trans. Image Process. 23(2), 943–951 (2014)

  20. 20.

    Huiskes, M.J., Lew, M.S.: The MIR Flickr retrieval evaluation. In: MIR’08: Proceedings of the 2008 ACM International Conference on Multimedia Information Retrieval. ACM, New York, NY, USA (2008)

  21. 21.

    Lacassagne, L., Zavidovique, B.: Light speed labeling for RISC architectures. In: ICIP, pp. 3245–3248 (2009)

  22. 22.

    Lacassagne, L., Zavidovique, B.: Light speed labeling: efficient connected component labeling on risc architectures. J. Real Time Image Proc. 6(2), 117–135 (2011)

  23. 23.

    Lewis, D., Agam, G., Argamon, S., Frieder, O., Grossman, D., Heard, J.: Building a test collection for complex document information processing. In: Proceedings of the 29th annual international ACM SIGIR conference on Research and development in information retrieval. ACM, pp. 665–666 (2006)

  24. 24.

    LTDL: The Legacy Tobacco Document Library (LTDL). University of California, San Francisco (2007)

  25. 25.

    Maltoni, D., Maio, D., Jain, A., Prabhakar, S.: Handbook of Fingerprint Recognition. Springer, Heidelberg (2009)

  26. 26.

    Matsumoto, M., Nishimura, T.: Mersenne twister: a 623-dimensionally equidistributed uniform pseudo-random number generator. ACM Trans. Model. Comput. Simul. (TOMACS) 8(1), 3–30 (1998)

  27. 27.

    Otsu, N.: A threshold selection method from gray-level histograms. IEEE Trans. Syst. Man Cybern. 9(1), 62–66 (1979)

  28. 28.

    Sauvola, J., Pietikäinen, M.: Adaptive document image binarization. Pattern Recogn. 33(2), 225–236 (2000)

  29. 29.

    Sutheebanjard, P., Premchaiswadi, W.: Efficient scan mask techniques for connected components labeling algorithm. EURASIP J. Image Video Process. 1, 1–20 (2011)

  30. 30.

    Tarjan, R.E.: Efficiency of a good but not linear set union algorithm. J. ACM 22(2), 215–225 (1975)

  31. 31.

    Torralba, A., Efros, A.A.: Unbiased look at dataset bias. In: IEEE Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, pp. 1521–1528 (2011)

  32. 32.

    Wu, K., Otoo, E., Suzuki, K.: Two Strategies to Speed up Connected Component Labeling Algorithms. Tech. Rep. LBNL-59102, Lawrence Berkeley National Laboratory (2005)

  33. 33.

    Wu, K., Otoo, E., Suzuki, K.: Optimizing two-pass connected-component labeling algorithms. Pattern Anal. Appl. 12(2), 117–135 (2009)

  34. 34.

    Zhao, H., Fan, Y., Zhang, T., Sang, H.: Stripe-based connected components labelling. Electron. Lett. 46(21), 1434–1436 (2010)

Download references

Author information

Correspondence to Costantino Grana.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Bolelli, F., Cancilla, M., Baraldi, L. et al. Toward reliable experiments on the performance of Connected Components Labeling algorithms. J Real-Time Image Proc (2018). https://doi.org/10.1007/s11554-018-0756-1

Download citation


  • Connected Components Labeling
  • Benchmarking
  • Performance Evaluation