skip to main content
article
Free Access

Filling regions in binary raster images: A graph-theoretic approach

Authors Info & Claims
Published:01 July 1980Publication History
Skip Abstract Section

Abstract

Filling regions in raster images is the term given to the problem of extracting a connected region (that contains some preselected seed pixel) and filling it with some color. A connected region is formally defined as the collection of all pixels that are in the transitive closure of a pixel-connectivity operator that is applied to the seed. For example, the 4-pixel-connectivity operator selects all pixels that are (spatially) 4-connected to the pixel operand, and have the same color. This problem can be solved relatively easily if the fill color is distinguishable so that every pixel, once colored (i.e. flagged OLD) will not be considered again. In binary images, the fill “color” is usually a binary pattern and therefore, a “colored” pixel may still have its previous (e.g., black or white) color. This fact makes the problem non-trivial.

In this paper, a region to be filled is represented as a connected directed a-cyclic planar graph in which nodes are regular regions (defined below) that are easy to handle. An arc connects a regular region to its neighbor below which shares a common horizontal sub-boundary. Based on this abstract representation of a region, a formulation of the filling problem is developed as a variant of graph traversing. The difficulties imposed by filling with a binary pattern, and the avoidance of an explicit description of the graph are explored and a solution is presented. This solution utilizes the frame buffer (that is used to display the image) for improved efficiency of a graph traversal algorithm.

This method turns out to be similar to [Lieberman-78], that is shown here to be incorrect. The complexity of the new algorithm is 0(N*L+ N*Log N), compared to 0(N*L*Log N) there, where N is the number of nodes in the graph and L is the average composite degree of each node. A proof of correctness for the new algorithm is given too.

References

  1. 1 Aho, A.V. et al. The Design and Analysis of Computer Algorithms, Addison Wesley, (1976). Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2 Berge, C. Graphs and Hyper Graphs, North Holland/American Alsevier, (1976). Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3 Guttag, S. Abstract data types and the development of data structures, CACM, 20(6), (June 1977), 396-404. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4 Kay, A.L. Microelectronics and the personal computer, Scientific American 273(3), (September 1977), 231-244.Google ScholarGoogle Scholar
  5. 5 Knuth, D.E. The Art of Computer Programming, vol 1, section 2.2.1. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6 Lieberman, H. How to color in a coloring book, Proceedings SIGGRAPH'78, (August 1978), 111-116. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7 Smith, A.R. Tint fill, Proc. SIGGRAPH'79, (August 1979), 276-283. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Filling regions in binary raster images: A graph-theoretic approach

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image ACM SIGGRAPH Computer Graphics
            ACM SIGGRAPH Computer Graphics  Volume 14, Issue 3
            July 1980
            327 pages
            ISSN:0097-8930
            DOI:10.1145/965105
            Issue’s Table of Contents

            Copyright © 1980 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 1 July 1980

            Check for updates

            Qualifiers

            • article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader