summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlab/spyrBand.m
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2020-10-19 23:09:30 -0400
committerleochanj105 <leochanj@live.unc.edu>2020-10-20 02:40:39 -0400
commitf618466c25d43f3bae9e40920273bf77de1e1149 (patch)
tree460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/texture_synthesis/src/matlab/spyrBand.m
parent47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff)
initial sd-vbs
initial sd-vbs add sd-vbs sd-vbs
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