summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlab/spyrBand.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/spyrBand.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlab/spyrBand.m34
1 files changed, 34 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/spyrBand.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/spyrBand.m
new file mode 100755
index 0000000..474a8dc
--- /dev/null
+++ b/SD-VBS/benchmarks/texture_synthesis/src/matlab/spyrBand.m
@@ -0,0 +1,34 @@
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
10% Eero Simoncelli, 6/96.
11
12function res = spyrBand(pyr,pind,level,band)
13
14if (exist('level') ~= 1)
15 level = 1;
16end
17
18if (exist('band') ~= 1)
19 band = 1;
20end
21
22nbands = spyrNumBands(pind);
23if ((band > nbands) | (band < 1))
24 error(sprintf('Bad band number (%d) should be in range [1,%d].', band, nbands));
25end
26
27maxLev = spyrHt(pind);
28if ((level > maxLev) | (level < 1))
29 error(sprintf('Bad level number (%d), should be in range [1,%d].', level, maxLev));
30end
31
32firstband = 1 + band + nbands*(level-1);
33res = pyrBand(pyr, pind, firstband);
34