spyrBand.m 819 B

12345678910111213141516171819202122232425262728293031323334
  1. % [LEV,IND] = spyrBand(PYR,INDICES,LEVEL,BAND)
  2. %
  3. % Access a band from a steerable pyramid.
  4. %
  5. % LEVEL indicates the scale (finest = 1, coarsest = spyrHt(INDICES)).
  6. %
  7. % BAND (optional, default=1) indicates which subband
  8. % (1 = vertical, rest proceeding anti-clockwise).
  9. % Eero Simoncelli, 6/96.
  10. function res = spyrBand(pyr,pind,level,band)
  11. if (exist('level') ~= 1)
  12. level = 1;
  13. end
  14. if (exist('band') ~= 1)
  15. band = 1;
  16. end
  17. nbands = spyrNumBands(pind);
  18. if ((band > nbands) | (band < 1))
  19. error(sprintf('Bad band number (%d) should be in range [1,%d].', band, nbands));
  20. end
  21. maxLev = spyrHt(pind);
  22. if ((level > maxLev) | (level < 1))
  23. error(sprintf('Bad level number (%d), should be in range [1,%d].', level, maxLev));
  24. end
  25. firstband = 1 + band + nbands*(level-1);
  26. res = pyrBand(pyr, pind, firstband);