function dec=gabsplev(im,evflag,odflag,border) % GABSPLEV obtains a whole level of the pyramidal Gabor decomposition. % % dec=gabsplev(im,evflag,odflag,border) % % INPUT PARAMETERS: % im -> input image % evflag -> if 1, compute the even channels % odflag -> if 1, compute the odd channels % border -> border handling (see conv2b) % % OUTPUT PARAMETERS: % dec -> 3-d array. Each matrix corresponds to an orientation, % (1-4)=> even, (4-8)=> odd (if even selected) % % ONG - 11/96 % evflag=(evflag~=0); odflag=(odflag~=0); odbase=4*evflag; % creation of filtered images [Ny Nx]=size(im); dec=zeros(Ny,Nx,4*(evflag+odflag)); % masks definition masks1d % horizontal channels (0 deg) % gaussian filtering in Y direction buff=conv2b(im, gaus', border); % gabor filtering in X direction if evflag dec(:,:,1)=conv2b(buff, gabhve, border); end if odflag dec(:,:,odbase+1)=conv2b(buff, gabhvo, border); end % vertical channels (90 deg) % gausian filtering in X direction buff=conv2b(im, gaus, border); % gabor filtering in Y direction if evflag dec(:,:,3)=conv2b(buff, gabhve', border); end if odflag dec(:,:,odbase+3)=conv2b(buff, gabhvo', border); end % diagonal channels % gabor even Y direction buff=conv2b(im, gabdie', border); if evflag gee=conv2b(buff, gabdie, border); end if odflag geo=conv2b(buff, gabdio, border); end % gabor odd Y direction buff=conv2b(im, gabdio', border); if evflag goo=conv2b(buff, gabdio, border); end if odflag goe=conv2b(buff, gabdie, border); end % sum the appropriate filters to obtain the final result if evflag dec(:,:,2)=gee-goo; dec(:,:,4)=gee+goo; end if odflag dec(:,:,odbase+2)=goe+geo; dec(:,:,odbase+4)=goe-geo; end