diff options
author | leochanj105 <leochanj@live.unc.edu> | 2020-10-19 23:09:30 -0400 |
---|---|---|
committer | leochanj105 <leochanj@live.unc.edu> | 2020-10-20 02:40:39 -0400 |
commit | f618466c25d43f3bae9e40920273bf77de1e1149 (patch) | |
tree | 460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/spyrLev.m | |
parent | 47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff) |
initial sd-vbs
initial sd-vbs
add sd-vbs
sd-vbs
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/spyrLev.m')
-rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/spyrLev.m | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/spyrLev.m b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/spyrLev.m new file mode 100755 index 0000000..5cb4a85 --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/spyrLev.m | |||
@@ -0,0 +1,24 @@ | |||
1 | % [LEV,IND] = spyrLev(PYR,INDICES,LEVEL) | ||
2 | % | ||
3 | % Access a level from a steerable pyramid. | ||
4 | % Return as an SxB matrix, B = number of bands, S = total size of a band. | ||
5 | % Also returns an Bx2 matrix containing dimensions of the subbands. | ||
6 | |||
7 | % Eero Simoncelli, 6/96. | ||
8 | |||
9 | function [lev,ind] = spyrLev(pyr,pind,level) | ||
10 | |||
11 | nbands = spyrNumBands(pind); | ||
12 | |||
13 | if ((level > spyrHt(pind)) | (level < 1)) | ||
14 | error(sprintf('Level number must be in the range [1, %d].', spyrHt(pind))); | ||
15 | end | ||
16 | |||
17 | firstband = 2 + nbands*(level-1); | ||
18 | firstind = 1; | ||
19 | for l=1:firstband-1 | ||
20 | firstind = firstind + prod(pind(l,:)); | ||
21 | end | ||
22 | |||
23 | ind = pind(firstband:firstband+nbands-1,:); | ||
24 | lev = pyr(firstind:firstind+sum(prod(ind'))-1); | ||