next up previous contents
Next: Indexing Using Quadtrees: Up: Division of Space by Previous: Common uses of Quad-trees   Contents

Representing Image Using Quad-tree:

Let's say we divide the picture area into 4 sections. Those 4 sections are then
further divided into 4 subsections. We continue this process, repeatedly dividing
a square region by 4. We must impose a limit to the levels of division otherwise
we could go on dividing the picture forever. Generally, this limit is imposed due to storage considerations or to limit processing time or due to the resolution of the
output device. A pixel is the smallest subsection of the quad tree.

To summarize, a square or quadrant in the picture is either :

  1. entirely one color
  2. composed of 4 smaller sub-squares
Figure 2.3: First three levels of quad tree
quad-tree1.png

To represent a picture using a quad tree, each leaf must represent a uniform area of the picture. If the picture is black and white, we only need one bit to represent the colour in each leaf; for example, 0 could mean black and 1 could mean white.
Now consider the following image : The definition of a picture is a two-dimensional array, where the elements of the array are colored points

Figure 2.4: Given Image
image1_quad.png

This is how the above image could be stored in a quad tree :

Figure 2.5: 8 x 8 pixel picture represented in a quad tree
image2_quad.png

Figure 2.6: The quad tree of the above example picture. The quadrants are shown in counterclockwise order from the top-right quadrant. The root is the top node. (The 2nd and 3rd quadrants are not shown.)
quadofimage.png


next up previous contents
Next: Indexing Using Quadtrees: Up: Division of Space by Previous: Common uses of Quad-trees   Contents
root 2006-04-11