Quadtrees, Octrees and their Applications in Digital Image Processing
Hierarchical Data Structures for Computer Vision and Image Processing Definition of pyramids Explanation of Quadtrees and Octrees Techniques used for generation Applications
What is a pyramid? A(0) A(1) A(2) 2 2 * * 2 1 Pyramid is a sequence of arrays
2 2 * * * 2 0 Example of a four layer pyramid
2 3 * 2 3 Layer 3 Example of a four layer pyramid
How partitioning is done? 1 partitioned to 2 2 = 4
How pyramid is build? From top to bottom From bottom to top Always recursively Good exercise in recursion and arrays Treat image as a Boolean or discrete function, what is the counterpart of these type of recursions?
We will build a pyramid from top For simplicity, dimension = 2 Partitioning at any level i from i-1 can be done by defining a two-dimensional array A(i) for the i-th level
The partitioning Algorithm Cell (j,k) at level i-1
The partitioning Algorithm
Pyramids are interlinked (for instance by indices) sequences of arrays with hierarchy. Similarly we can create trees to define this hierarchy Trees can be more convenient for processing Pyramids versus trees
Types of pyramids: quadtree and octree
Recursive Tree Decomposition Think how to write this software in Lisp
Construction of the quadtree We get an image represented by a quadtree
Trees can be well manipulated in software, for instance in Lisp Advantages of the quadtree
Disadvantages of the quadtree
Structure of an Octree Octrees are to represent three- dimensional robot environments
Structure of an Octree
Advantages of the Octrees
Applications of these data structures The quadtree, octree and binary tree decomposition methods are widely used in two and three dimension image processing and computer graphics Some of the application areas involve: the image data structure, region representation, picture segmentation, component labeling, image smoothing, image enhancement, data compression
Pattern recognition Shape analysis Image segmentation Region matching Images can be represented with pyramids and thus, both local and global feature extraction is possible Applications of these data structures
Application to pattern recognition
We want to know where is B located structurally in our image
We got here the structure of our environment
Tree Decomposition in Pattern Classification Tree decomposition can be used not only in image space but in transform space or feature space
Tree Decomposition in Pattern Classification
Application of trees to Edge Detection The edge detection task can be accomplished by applying a point-neighborhood operator or the edge detector to every point of a large matrix The algorithm for this works as follows: An edge detector is applied at each point in the starting level At each point, if the value exceeds a threshold, the operation is applied to the descendants of the point in the next finer level. Starting from top
Application of trees to Feature Detection Pyramides are used for feature detection Pyramides are used for feature extraction Pyramides limit scope of the search
The disadvantage of this method is that the reduction of resolution will affect the visual appearance of edges and small objects In particular, at a coarser level of resolution: edges tend to get smeared and region separation may disappear Application of trees to Feature Detection
Extracting compact objects using trees Many image analysis tasks require the extraction of compact objects from a background, where the shapes of the desired objects are not known, compact except for the fact that they are compact Image segmentation using pyramids can be applied to extract such objects. “Spot detectors” are applied to image at each level of the pyramid: this is equivalent to applying spot detectors of many sizes to full- resolution image
Extracting compact objects using trees
Three sets of information are represented in the pyramid structure 1. Gray level 2. Edge magnitude and direction 3. Surroundedness The interaction between the different types of information at each level of the pyramid leads to the final segmentation Extracting compact objects using trees
Using Quadtrees to Smooth Images noise of various kinds Digital images usually contain noise of various kinds. Most image processing tasks are simplified if noise is removed A general approach to noise removal is to smooth the image Smoothing Smoothing is done by replacing each pixel value by a new value which is a function of the values in some neighborhood of the pixel.
Using Quadtrees to Smooth Images Method 1 Method 2 See next slides
Using Quadtrees to Smooth Images
Smoothing becomes hierarchical in trees
Using Quadtrees to Smooth Images Method 2 1. Constructs a quadtree from an image 2. Replaces each pixel by the gray level of the leaf to which each corresponds Using Quadtrees to Smooth Images
Hierarchical Coding of Binary Images using trees Hierarchical Coding = to segment a picture into the largest possible uniform areas and to transmit a hierarchical representation of these areas. Quadtrees can be used for coding Pictures with large uniform areas can be highly compressed
The transmission result can be recreated by the receiver as soon as sufficient information about transmitted picture has been gathered Hierarchical Coding of Binary Images using trees
Quadtree Compression
ww W=white B=black G = goto ground Second level
Hierarchical Coding of Binary Images GGGWWBBWBWGWGWWWBBWWW