Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 24 lines (18 sloc) 0.668 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
% [LEV,IND] = spyrLev(PYR,INDICES,LEVEL)
%
% Access a level from a steerable pyramid.
% Return as an SxB matrix, B = number of bands, S = total size of a band.
% Also returns an Bx2 matrix containing dimensions of the subbands.

% Eero Simoncelli, 6/96.

function [lev,ind] = spyrLev(pyr,pind,level)

nbands = spyrNumBands(pind);

if ((level > spyrHt(pind)) | (level < 1))
  error(sprintf('Level number must be in the range [1, %d].', spyrHt(pind)));
end

firstband = 2 + nbands*(level-1);
firstind = 1;
for l=1:firstband-1
  firstind = firstind + prod(pind(l,:));
end

ind = pind(firstband:firstband+nbands-1,:);
lev = pyr(firstind:firstind+sum(prod(ind'))-1);
Something went wrong with that request. Please try again.