spyrNumBands.m 480 B

1234567891011121314151617181920
  1. % [NBANDS] = spyrNumBands(INDICES)
  2. %
  3. % Compute number of orientation bands in a steerable pyramid with
  4. % given index matrix. If the pyramid contains only the highpass and
  5. % lowpass bands (i.e., zero levels), returns 0.
  6. % Eero Simoncelli, 2/97.
  7. function [nbands] = spyrNumBands(pind)
  8. if (size(pind,1) == 2)
  9. nbands = 0;
  10. else
  11. % Count number of orientation bands:
  12. b = 3;
  13. while ((b <= size(pind,1)) & all( pind(b,:) == pind(2,:)) )
  14. b = b+1;
  15. end
  16. nbands = b-2;
  17. end