www.pudn.com > SPIHT_bandelet.rar > perform_alpert_transform_2d.m
function [w,info] = perform_alpert_transform_2d(v,pos,k, dir, options)
% perform_alpert_transform_1p5d - transform a 2D signal.
%
%
% [w,info] = perform_alpert_transform_1p5d(v,pos,k, dir, options);
%
% 'v' is a 1D vector, the value of the function at each sampling location.
% 'pos' is a 2D vector, pos(:,i) is the ith point.
% 'k' is the number of vanishing moments (1=>Haar, 2=>linear basis ...).
% * 'k' can be an integer, and then the algorithm will use the same
% order for X and Y direction.
% * 'k' can be a couple of integer k=[kx,ky] and 'kx' will be the
% order on the X direction, and 'ky' the order on the Y direction.
% * 'k' can be a set of monomial, see below ('degree_type') for
% further comments.
% 'dir' is 1 for fwd transform and -1 for bwd.
%
% 'options' is a structure that can contains the followind field :
% 'degree_type' : Polynomial degree. By default, the multiresolution spaces are defined
% as piecewise polynimals P that satisfy
% degX(P)m
m = m+1;
i = 0;
end
end
case 'user_defined'
monomials = k;
otherwise
error('Unknown degree type.');
end
k2 = size(monomials,2)/2; % equivalent to k^2 in Alpert paper.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% find a regroupement
if isempty(part)
clear options;
options.ptmax = k2;
options.part_type = part_type;
[part,B,G] = dichotomic_grouping(pos,options);
end
if exist('perform_moment_transform')>0 && use_mex
w = perform_moment_transform(v,pos, monomials, dir, part);
info = [];
else
[w,info] = perform_moment_transform_slow(v,pos, monomials, dir, part);
end