Skip to main content
Log in

In-place Algorithm for Erasing a Connected Component in a Binary Image

  • Published:
Theory of Computing Systems Aims and scope Submit manuscript

Abstract

Removing noise in a given binary image is a common operation. A generalization of the operation is to erase an arbitrarily specified component by reversing pixel values in the component. This paper shows that this operation can be done without using any data structure like a stack or queue, or more exactly using only constant extra memory (consisting of a constant number of words of O(log n) bits for an image of n pixels) in O(mlog m) time for a component consisting of m pixels. This is an in-place algorithm, but the image matrix cannot be used as work space since it has just one bit for each pixel. Whenever we flip a pixel value in a target component, the component shape is also deformed, which causes some difficulty. The main idea for our constant work space algorithm is to deform a component so that its connectivity is preserved.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Asano, T., Bitou, S., Motoki, M., Usui, N.: In-place algorithm for image rotation. In: Proc. ISAAC 2007, Sendai, Dec. 2007, pp. 704–715 (2007)

    Google Scholar 

  2. Asano, T.: Constant-working-space image scan with a given angle. In: Proc. 24th European Workshop on Computational Geometry, Nancy, France, pp. 165–168 (2008)

    Google Scholar 

  3. Asano, T., Bereg, S., Kirkpatrick, D.: Finding nearest larger neighbors: a case study in algorithm design and analysis. In: Albers, S., Alt, H., Naeher, S. (eds.) Efficient Algorithms. Lecture Notes in Computer Science, pp. 249–260. Springer, Berlin (2009)

    Chapter  Google Scholar 

  4. Asano, T., Tanaka, H.: Constant-working space algorithm for connected components labeling. Technical report, Special Interest Group on Computation, IEICE of Japan, 2008

  5. Bose, P., Morin, P.: An improved algorithm for subdivision traversal without extra storage. Int. J. Comput. Geom. Appl. 12(4), 297–308 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  6. Brönnimann, H., Chen, E.Y., Chan, T.M.: Towards in-place geometric algorithms and data structures. In: Proc. 20th Annual ACM Symposium on Computational Geometry, pp. 239–246 (2004)

    Google Scholar 

  7. de Berg, M., van Kreveld, M., van Oostrum, R., Overmars, M.: Simple traversal of a subdivision without extra storage. Int. J. Geogr. Inf. Sci. 11(4), 359–373 (1997)

    Article  Google Scholar 

  8. Klette, R., Rosenfeld, A.: Digital Geometry: Geometric Methods for Digital Picture Analysis. Elsevier, Amsterdam (2004)

    Google Scholar 

  9. Kwok, P.: A thinning algorithm by contour generation. Commun. ACM, 31(11), 1314–1324 (1988)

    Article  Google Scholar 

  10. Lam, L., Lee, S.-W., Suen, C.Y.: Thinning methodologies—a comprehensive survey. IEEE Trans. Pattern Anal. Mach. Intell. 14(9), 869–885 (1992)

    Article  Google Scholar 

  11. Malgouyresa, R., Moreb, M.: On the computational complexity of reachability in 2D binary images and some basic problems of 2D digital topology. Theor. Comput. Sci. 283, 67–108 (2002)

    Article  Google Scholar 

  12. Rosenfeld, A.: Connectivity in digital pictures. J. ACM 17(3), 146–160 (1970)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tetsuo Asano.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Asano, T. In-place Algorithm for Erasing a Connected Component in a Binary Image. Theory Comput Syst 50, 111–123 (2012). https://doi.org/10.1007/s00224-011-9335-6

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00224-011-9335-6

Keywords

Navigation