Code covered by the BSD License  

Highlights from
Quad-Tree segmentation - MEX

Be the first to rate this file! 16 Downloads (last 30 days) File Size: 8.67 KB File ID: #27993

Quad-Tree segmentation - MEX

by Ahmad

 

23 Jun 2010 (Updated 13 Jul 2010)

Segments an input image using Quad-trees

| Watch this File

File Information
Description

QUADTREESEG - mex implementation (compile by mex quadtreeseg.cpp). Also an equivalent MATLAB implementation is present in zip file.

Segments an image by recursively dividing it into four equal blocks if the variability in its pixels is greater than a certain amount. The image input is usually square, or the segments output are proportional to the aspect ratio of the input image. This function gives you a choice on the variability function: the std. dev. in pixel values; the range of pixel values. If given a color image, the average of these measures is used across the 3 layers.

@args:
      im: the input image (RGB or Grayscale) which needs to be segmented; could be uint8, uint16, or double
      (variance_mode): 0 for range of pixel values; 1 for std. dev. of pixel values. Default 0
      (thresh_std): maximum allowed standard deviation or range inside a segment. Value needs to be between 0 and 1. If using uint8 images the value is scaled by 255, and for uint16 it is scaled by 65535. if variance_mode=0, Default 0.2; variance_mode=1, Default 0.05
      (min_block_size): Size 2 vector for minimum segment size
      (min_block_size): Size 2 vector for maximum segment size

Example:
     i = imread('josh-brolin.jpg');
     seg_map = quadtreeseg(i, 0.05, [1 1], [60 60]);
     imagesc(i);

MATLAB release MATLAB 7.9 (2009b)
Other requirements MEX Compiled using Microsoft Visual C++ 2008 SP1
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
13 Jul 2010

Corrected a mistake in the example given in the .m file

13 Jul 2010

updated general info

Tag Activity for this File
Tag Applied By Date/Time
quadtree Ahmad 23 Jun 2010 10:34:19
segmentation Ahmad 23 Jun 2010 10:34:19
clustering Ahmad 23 Jun 2010 10:34:20

Contact us at files@mathworks.com