function [l, lpr, hpr]=gabsppyr(im,L,evflag,odflag,border) % GABSPPYR Gabor spatial pyramidal decomposition % % [l, lpr, <hpr>]=gabsppyr(im,L,evflag,odflag,border) % % INPUT PARAMETERS: % im -> input image % L -> number of frequency levels % evflag -> if 1, compute the even channels % odflag -> if 1, compute the odd channels % border -> border handling (see conv2b) % % OUTPUT PARAMETERS: % l -> cell containing the levels % lpr -> low-pass residual % hpr -> (optional) high-pass residual % % ONG - Revised 12/97 % hprflag=(nargout==3); imo=im; lpf=[1 4 6 4 1]/16; % loop for all levels for lev=L:-1:1 l{lev}=gabsplev(im,evflag,odflag,border); im=conv2b(conv2b(im,lpf,border),lpf',border); if (lev==L)&(hprflag) % computes the hpr hpr=imo-im-0.75*sum(l{lev},3); end [Ny Nx]=size(im); if lev~=1 im=im(1:2:Ny,1:2:Nx); end end lpr=im;