Download presentation
Presentation is loading. Please wait.
Published byMelissa Liliana Johnson Modified over 9 years ago
1
Computer Graphics1 Quadtrees & Octrees
2
Computer Graphics2 Quadtrees n A hierarchical data structure often used for image representation. n Quadtrees encode two-dimensional images by placing subsections of the image into a tree structure much like a binary tree. n Unlike a binary tree where every tree node has up to two children, in a quadtree every node can have up to four children. n Each node stores a particular piece of the overall image. n Quadtrees operate by means of recursively decomposing space.
3
Computer Graphics3 Quadtrees - Cont. n The most common type of quadtrees are known as region quadtrees. n In such trees the image to be encoded and stored is partitioned into four quadrants. n Each quadrant is then represented by a node in the tree. n The root of the quadtree represents the entire stored image while each of it's four children represent a different fourth of the image. n This process continues; each of the quadrants represented by the children of the root is again partitioned into four sub-quadrants and represented by the root's grandchildren nodes.
4
Computer Graphics4 Quadtrees - Cont. n This process continues until a region being stored is sufficiently simple that it can be wholly encoded in one node. n Sometimes this means that we continue breaking the image down until every individual pixel is stored at some leaf node. n If a region larger than a pixel is sufficiently homogeneous it can be represented at a leaf node and requires no further decomposition. n For example, if an entire quadrant is one color it does not make sense to continue to decompose it.
5
Computer Graphics5 An Octree n An octree is essentially the same thing as a quadtree however each node in an octree has eight children instead of four. n This makes octrees good candidates for representing three- dimensional objects in memory because instead of breaking the image into four quadrents the octree breaks the space into eight blocks. n These blocks are then recursively decomposed into eight sub-blocks. n This process, as in the quadtree case, continues until a block is sufficiently homogeneous that it can be represented by one node.
6
Computer Graphics6 Example: 01234567
7
Computer Graphics7 Uses n An interesting property of both quadtrees and octrees is that they support a form of data compression. n By never traversing below a certain level of the tree structure it is possible to filter out the "details" of the image, for a less-precise but smaller version of the data. n Such a compression could be accomplished by means of a breadth-first traversal of the tree data structure.
8
Computer Graphics8 Quadtree example
9
Computer Graphics9 Example - Cont. 1 2 34 1234
10
Computer Graphics10 Example - Cont. 1 2.1 3.1 4 14 2.12.22.32.43.13.43.33.2 2.2 2.32.4 3.2 3.33.4
11
Computer Graphics11 Quadtree - oprators n It is possible to use the Quadtree representation for operations between two images/objects. n The most common uses are for Boolean openrators: u Union u Intersection u Difference u Complementary
12
Computer Graphics12 Union += =+ +=+ + + = = =
13
Computer Graphics13 Intersection *= =* *=* * * = = =
14
Computer Graphics14 Difference -= =- -=- - - = = =
15
Computer Graphics15 Complementary = = =
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.