IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. PAMI-7, NO. 2, MARCH 1985 Geometric Algorithms for Digitized Pictures on a Mesh-Connected Computer RUSS MILLER, STUDENT MEMBER, IEEE, AND QUENTIN F. STOUT, MEMBER, IEEE Abstract-Although mesh-connected computers are used almost ex- clusively for low-level local image processing, they are also suitable for higher level image processing tasks. We illustrate this by presenting new optimal (in the 0-notational sense) algorithms for computing several geometric properties of figures. For example, given a black/white pic- ture stored one pixel per processing element in an n X n mesh-connected computer, we give 0(n) time algorithms for determining the extreme points of the convex hull of each component, for deciding if the convex hull of each component contains pixels that are not members of the component, for deciding if two sets of processors are linearly separable, for deciding if each component is convex, for determining the distance to the nearest neighboring component of each component, for deter- mining internal distances in each component, for counting and marking minimal internal paths in each component, for computing the external diameter of each component, for solving the largest empty circle prob- lem, for determining internal diameters of components without holes, and for solving the all-points farthest point problem. Previous mesh- connected computer algorithms for these problems were either nonex- istent or had worst case times of 0 (n 2). Since any serial computer has a best case time of 0(n 2) when processing an n X n image, our algo- rithms show that the mesh-connected computer provides significantly better solutions to these problems. Index Terms- Computational geometry, convexity, image processing, mesh-connected computer. I. INTRODUCTION M XESH-connected computers (MCC's) have long been proposed for image processing. Images can be naturally mapped onto an MCC so that neighboring pixels are mapped onto neighboring (or the same) processing elements. Because of this, local operations on the image, such as edge detection or median filtering, can be performed by local operations on the mesh, enabling such algorithms to efficiently exploit the massive parallelism available. Many discussions of actual MCC's, such as the SOLOMON, ILLIAC III, CLIP4, or MPP, emphasize their speed on local operations [4], [11], [18], [20] ,and most of the early papers on MCC's, such as those of Unger [30] - [32] and Golay [8], similarly emphasized local operations. In this paper we consider higher level image processing and pattern recognition tasks which require combining information globally. We concentrate on geometric problems involving convexity, internal distance, and external distance. For some Manuscript received January 20, 1984; revised July 23, 1984. This work was supported by the National Science Foundation under Grant MCS-83-01019. R. Miller is with the Department of Mathematical Sciences, State University of New York, Binghamton, NY 13901. Q. F. Stout was with the Department of Mathematical Sciences, State University of New York, Binghamton, NY 13901. He is now with the Department of Electrical Engineering and Computer Science, University of Michigan, Ann Arbor, MI 48109. problems, notably the Euler number [9], [15], connectivity [3 ], [13 ], and skeletization [23 ] , it is possible to iterate local operations to achieve an optimal solution to a global problem. However, this approach seems to work only in isolated prob- lems. (For example, the Beyer and Levialdi "shrinking" ap- proach to connectivity problems of digitized pictures [3], [ 1 3 ] does not extend to higher dimensions. A solution strategy similar to ones presented in this paper was needed for optimal algorithms in dimensions greater than two [24].) Instead of local operations, our algorithms emphasize the use of sorting and graph-theoretic algorithms. The same approach was used by Nassimi and Sahni [17] in their optimal MCC algorithm for labeling the connected components of digitized pictures. The algorithms presented in this paper are always optimal in the 0-notational sense, and we have tried to make them as general as possible. The paper is organized as follows. In Section II, we define the MCC model and review standard MCC algorithms that will be used throughout the paper. In Section III, given an n X n black/white picture stored one pixel (picture element) per processing element in an n X n MCC, we give 0(n) time algo- rithms for computing internal distances, marking minimal internal paths, and counting the number of these paths for each component of the picture. These problems arose in an image processing task considered in [10], and our algorithms are faster than their 0(n2) algorithms. In Section IV, we give a 0(n) time algorithm for marking the extreme points of the convex hull for every labeled set of processors. We also give 0(n) time algorithms for deciding if the convex hull of each component contains pixels that are not members of the com- ponent, for deciding if two sets of processors are linearly separable, for solving the smallest box problem, and for decid- ing if each black figure is convex [21], [29]. Previously, [5] and [12] described algorithms that decided convexity of fig- ures, but their algorithms require 0(n2) time in the worst case. In Section V, we show how to compute the distance between components in 0(n) time, where the distance can be measured by almost any metric. A 0(n) solution also appears in Dyer and Rosenfeld [5], but their solution can only be used with the 11 ("taxicab" or "city block") and lo. ("chessboard") metrics. Section V also contains optimal solutions to nearest neighbor, radius query, and farthest point problems [21]. II. PRELIMINARIES A. Notation We use Q to mean "order at least," 0 to mean "order no greater," and 0 to mean "order exactly." 0162-8828/85/0300 -0216$01.00 © 1985 IEEE 216 Authorized licensed use limited to: University of Michigan Library. Downloaded on January 22, 2010 at 15:11 from IEEE Xplore. Restrictions apply.