Wednesday, 9 May 2012

Region using quadtree


The region quadtree represents a partition of space in two dimensions by decomposing the region into four equal quadrants, subquadrants, and so on with each leaf node containing data corresponding to a specific subregion. Each node in the tree either has exactly four children, or has no children (a leaf node). The region quadtree is not strictly a tree - as the positions of subdivisions are independent of the data. They are more precisely called tries.

A region quadtree with a depth of n may be used to represent an image consisting of 2n × 2n pixels, where each pixel value is 0 or 1. The root node represents the entire image region. If the pixels in any region are not entirely 0s or 1s, it is subdivided. In this application, each leaf node represents a block of pixels that are all 0s or all 1s.

A region quadtree may also be used as a variable resolution representation of a data field. For example, the temperatures in an area may be stored as a quadtree, with each leaf node storing the average temperature over the subregion it represents.

If a region quadtree is used to represent a set of point data (such as the latitude and longitude of a set of cities), regions are subdivided until each leaf contains at most a single point.


 
Original

Quadtree

There's an a Region QuadTree Demo.
Try it : )

Tuesday, 8 May 2012

FREQUENCY DOMAIN PROCESSING (LAB 4)

Welcome to lab 4! What on earth we are going to learn today? Well, its all about Frequency domain processing.

What you need to understand for lab 4?

  1. DISCRETE FOURIER TRANSFORM
  2. LOWPASS AND HIGHPASS FREQUENCY DOMAIN FILTERS
Tips: Always ask yourself  WHAT & HOW question to make sure you understand this lab exercise.


------------------------------------------------------------------------------------------------------

Discrete Fourier Transform(DFT)

  • Concept: any waveform that can be constructed using a sum of sine and cosine waves of different frequencies.

  • Equation : 

(2d DFT)

(Inverse 2d DFT)
  • MATLAB CODE
  • Relation between DFT with Spatial Domain Filtering


The results is very similar after filtering in the condition of they both have negative values, use absolute function to get rid of negatives and threshold into a binary image. This are the results. 

Monday, 7 May 2012

Region Splitting and Merging

Region Splitting and Merging

  • Splitting or merging not produce good results when apply separately.
  • Better results can be obtained by interleaving merge and split operations.

Region Splitting

Region Splitting

  • This operation add missing boundaries by splitting regions that contain parts of different objects.
  • Splitting schemes begin with a partition satisfying condition, for example the whole image.
  • Then they proceed to satisfy condition by gradually splitting image regions
  • Two difficulties in implementing this approach:
          - Deciding when to split a region
          - Deciding how to split a region


Region Merging

Region Merging

  • This operation eliminates false boundaries and spurious regions by merging adjacent regions that belong to the same object.
  • Merging schemes begin with a partition satisfying condition
  • Then they proceed to fulfill condition by gradually merging adjacent image regions

  • How to determine region similarity?
          - Based on the gray values of the regions.

          - Based on the weakness of boundaries between the regions.
  • Region merging by removing weak edges.
          - The idea is to combine two regions if the boundary between them is weak.
          - A weak boundary is one for which the intensities on either side differ by less than some threshold. 
          - The relative lengths between the weak boundary and the region boundaries must be also considered.