Abstract
The basic shape features of an object in a binary image, i.e., the area, perimeter, circularity, and centroid, are important for image analysis and pattern recognition. In conventional algorithms, to calculate the basic shape features of objects in a binary image, it is usually necessary to first perform connected-component labeling to generate a labeled image (intermediate image), in which every image object is assigned a unique label so that it may be distinguished. Using the labeled image, the basic shape features of the object corresponding to each label can then be calculated. When a two-scan labeling algorithm is used, three scans are necessary. This paper proposes an efficient algorithm for calculating the shape features of objects in a binary image. Instead of a labeled image, our proposed algorithm calculates the basic shape features of objects using the image and the representative label table generated by the first scan of an efficient two-scan labeling algorithm. Thus, we can compute shape features using two scans. Experiments demonstrate that our proposed algorithm is much more efficient than conventional algorithms for calculating the basic shape features of objects in a binary image.









Similar content being viewed by others
Notes
In fact, as indicated in [13], any label propagation algorithm will process some object pixels many times. Therefore, strictly speaking, label propagation algorithms are not one-scan algorithms.
Obviously, all foreground pixels in the mask have already been processed (thus, have a provisional label) and belong to the same connected component (thus, all labels assigned to the foreground pixels in the mask are equivalent labels).
Note that the CT algorithm used here is specifically for labeling objects without holes.
The density of a binary image is the percent of foreground pixels in the image.
Because we only fill holes, the number of objects in the original and corresponding revised images are exactly the same.
References
Gonzalez, R.C., Woods, R.E.: Digital Image Processing. Addison-Wesley, Reading (1993)
Rosenfeld, A., Kak, A.C.: Digital Picture Processing, vol. 2, 2nd edn. Academic Press, San Diego (1982)
Pratt, W.K.: Introduction to Digital Image Processing. CRC Press, Boca Raton (2013)
Szeliski, R.: Computer Vision: Algorithms and Applications. Springer, Berlin (2011)
Rosenfeld, A., Pfalts, J.L.: Sequential operations in digital picture processing. J. ACM 13(4), 471–494 (1966)
Rosenfeld, A.: Connectivity in digital pictures. J. ACM 17(1), 146–160 (1970)
Suzuki, K., Horiba, I., Sugie, N.: Linear-time connected-component labeling based on sequential local operations. Comput. Vis. Image Underst. 89, 1–23 (2003)
Lumia, R., Shapiro, L., Zungia, O.: A new connected components algorithm for virtual memory computers. Comput. Vis. Graph. Image Process. 22(2), 287–300 (1983)
Wu, K., Otoo, E., Suzuki, K.: Optimizing two-pass connected-component labeling algorithms. Pattern Anal. Appl. 12(2), 117–135 (2009)
He, L., Chao, Y., Suzuki, K.: A linear-time two-scan labeling algorithm. In: 2007 IEEE International Conference on Image Processing (ICIP), pp. V-241–V-244, September 2007, San Antonio, Texas, USA (2007)
He, L., Chao, Y., Suzuki, K.: A run-based two-scan labeling algorithm. IEEE Trans. Image Process. 17(5), 749–756 (2008)
He, L., Chao, Y., Suzuki, K., Wu, K.: Fast connected-component labeling. Pattern Recogn. 42(9), 1977–1987 (2009)
He, L., Chao, Y., Suzuki, K.: An efficient first-scan method for label-equivalence-based labeling algorithms. Pattern Recogn. Lett. 31(1), 28–35 (2010)
He, L., Chao, Y., Suzuki, K.: A run-based one-and-a-half-scan connected-component labeling algorithm. Int. J. Pattern Recogn. Artif. Intell. 24(4), 557–579 (2010)
Grana, C., Borghesani, D., Cucchiara, R.: Optimized block-based connected components labeling with decision trees. IEEE Trans. Image Process. 9(6), 1596–1609 (2010)
He, L., Zhao, X., Chao, Y., Suzuki, K.: Configuration-transition-based connected-component labeling. IEEE Trans. Image Process. 23(2), 943–951 (2014)
Chang, W., Chiu, C., Yang, J.: Block-based connected-component labeling algorithm using binary decision trees. Sensors 15(9), 23763–23787 (2015)
Shoji, K., Miyamichi, J.: Connected component labeling in binary images by run-based contour tracing. Trans. Inst. Electron. Inf. Commun. Eng. D-II J83-D-II(4), 1131–1139 (1995)
Shima, Y., Murakami, T., Koga, M., Yashiro H., Fujisawa, H.: A high-speed algorithm for propagation-type labeling based on block sorting of runs in binary images. In: Proceedings of 10th International Conference Pattern Recognition, pp. 655–658 (1990)
Chang, F., Chen, C.J., Lu, C.J.: A linear-time component-labeling algorithm using contour tracing technique. Comput. Vis. Imaging Underst. 93, 206–220 (2004)
Jain, A.K., Vailaya, A.: Shape-based retrieval: a case-study with trademark image databases. Pattern Recogn. 31, 1369–1390 (1998)
Proffitt, D.: The measurement of circularity and ellipticity on a digital grid. Pattern Recogn. 15, 383–387 (1982)
Wang, L., Tan, T.N., Hu, W.M., Ning, H.Z.: Automatic gait recognition based on statistical shape analysis. IEEE Trans. Image Process. 12, 1120–1131 (2003)
Zunic, J., Hirota, K., Rosin, P.L.: A Hu invariant as a shape circularity measure. Pattern Recogn. 43, 47–57 (2010)
Gotoh, T., Ohta, Y., Yoshida, M., Shirai, Y.: Component labeling algorithm for video rate processing. In: Proceeding of the SPIE, Advances in Image Processing, vol. 804, pp. 217–224 (1987)
Tarjan, R.E.: Efficiency of a good but not linear set union algorithm. J. ACM 22(2), 215–225 (1975)
Tarjan, R.E., Leeuwen, J.V.: Worst-case analysis of set union algorithms. J. ACM 31(2), 245–281 (1984)
Acknowledgments
We would like to thank our editor and the anonymous referees for their valuable comments, which greatly improved this paper. This work was supported in part by the Grant-in-Aid for the National Natural Science Foundation of China under Grant No. 61471227, the Scientific Research (C) of the Ministry of Education, Science, Sports and Culture of Japan under Grant No. 26330200, and the Scientific Research of Shaanxi Province of China under Grant No. 2014K11-02-01-13.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
He, L., Ren, X., Zhao, X. et al. An efficient two-scan algorithm for computing basic shape features of objects in a binary image. J Real-Time Image Proc 16, 1277–1287 (2019). https://doi.org/10.1007/s11554-016-0626-7
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11554-016-0626-7