An algorithm is presented for converting a boundary representation for an image to its region quad-tree representation. Our algorithm is designed for operation on the linear quadtree representation, although it can easily be modified for the traditional pointer-based quadtree representation. The algorithm is a two phase process that first creates linear quadtree node records for each of the border pixels. This list of pixels is then sorted by locational code. The second processing phase fills in the nodes interior to the polygons by simulating a traversal of the corresponding pointer-based quadtree. Three previous algorithms [Same80, Mark85a, Atki86] have described similar conversion routines requiring time complexity of O(n.B)for at least one of the two phases, where B is the number of boundary pixels and n is the depth of the final tree for a 2" x 2" image. A fourth algorithm [Webb84] can perform the border construction of this conversion in time O(n+B) with the restriction that the polygon must be positioned at constrained locations in the image space. Our algorithm requires time O(n + B) for the second phase, which is optimal. The first phase can be performed using the algorithm of [Webb84] for total conversion time of O(n + B) with constrained location, or in time O(B log B) using a simple sort to order the border pixels with no restriction in polygon location.
[1]
Clifford A. Shaffer.
Application of alternative quadtree representations
,
1986
.
[2]
Hanan Samet,et al.
Region representation: quadtrees from boundary codes
,
1980,
CACM.
[3]
Kurt Mehlhorn,et al.
Sorting Jordan Sequences in Linear Time Using Level-Linked Search Trees
,
1986,
Inf. Control..
[4]
K. Steiglitz,et al.
Operations on ImagesUsingQuadTrees
,
1979
.
[5]
Clifford A. Shaffer,et al.
Set Operations for Unaligned Linear Quadtrees
,
1990,
Comput. Vis. Graph. Image Process..
[6]
Irene Gargantini,et al.
Filling by quadrants or octants
,
1986,
Comput. Vis. Graph. Image Process..
[7]
David M. Mark,et al.
Linear Quadtrees from Vector Representations of Polygons
,
1985,
IEEE Transactions on Pattern Analysis and Machine Intelligence.
[8]
Hanan Samet,et al.
Applications of spatial data structures
,
1989
.
[9]
G. M. Hunter,et al.
Linear transformation of pictures represented by quad trees
,
1979
.
[10]
Irene Gargantini,et al.
An effective way to represent quadtrees
,
1982,
CACM.
[11]
Hanan Samet,et al.
The Design and Analysis of Spatial Data Structures
,
1989
.
[12]
Irene Gargantini,et al.
Linear quadtrees: A blocking technique for contour filling
,
1984,
Pattern Recognit..