Home > freetb4matlab > image > qtdecomp.m

qtdecomp

PURPOSE ^

% Performs quadtree decomposition.

SYNOPSIS ^

function S = qtdecomp(I, p1, varargin)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {@var{S} = } qtdecomp (@var{I})
% @deftypefnx {Function File} {@var{S} = } qtdecomp (@var{I},@var{threshold})
% @deftypefnx {Function File} {@var{S} = } qtdecomp (@var{I},@var{threshold},@var{mindim})
% @deftypefnx {Function File} {@var{S} = } qtdecomp (@var{I},@var{threshold},@var{[mindim maxdim]})
% @deftypefnx {Function File} {@var{S} = } qtdecomp (@var{I},@var{fun})
% @deftypefnx {Function File} {@var{S} = } qtdecomp (@var{I},@var{fun},@var{P1},@var{P2},...)
% Performs quadtree decomposition.
%
% qtdecomp decomposes a square image @var{I} into four equal-sized
% blocks. Then it performs some kind of test on each block to decide if
% it should decompose them further. This process is repeated
% iteratively until there's no block left to be decomposed.
%
% Note that blocks are not decomposed if their dimensions are not even.
%
% The output is a sparse matrix whose non-zero elements determine the
% position of the block (the element is at top-left position in the
% block) and size of each block (the value of the element determines
% length of a side of the square-shaped block).
%
% S = qtdecomp(I) decomposes an intensity image @var{I} as described
% above. By default it doesn't split a block if all elements are equal.
%
% S = qtdecomp(I, threshold) decomposes an image as decribed, but only
% splits a block if the maximum value in the block minus the minimum
% value is greater than @var{threshold}, which is a value between 0 and
% 1. If @var{I} is of class uint8, @var{threshold} is multiplied by 255
% before use. Also, if@var{I} is of class uint16, @var{threshold} is 
% multiplied by 65535.
%
% S = qtdecomp(I, threshold, mindim) decomposes an image using the
% @var{threshold} as just described, but doesn't produce blocks smaller
% than mindim.
%
% S = qtdecomp(I, threshold, [mindim maxdim]) decomposes an image as
% described, but produces blocks that can't be bigger than maxdim. It
% decomposes to maxdim even if it isn't needed if only @var{threshold}
% was considered.
%
% S = qtdecomp(I, fun) decomposes an image @var{I} and uses function
% @var{fun} to decide if a block should be splitted or not. @var{fun}
% is called with a m-by-m-by-k  array of m-by-m blocks to be
% considered, and should return a vector of size k, whose elements
% represent each block in the stacked array. @var{fun} sets the
% corresponding value to 1 if the block should be split, and 0
% otherwise.
%
% S = qtdecomp(I, fun, ...) behaves as qtdecomp(I, fun) but passes
% extra parameters to @var{fun}.
%
% @seealso{qtgetblk, qtsetblk}
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003