From f618466c25d43f3bae9e40920273bf77de1e1149 Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Mon, 19 Oct 2020 23:09:30 -0400 Subject: initial sd-vbs initial sd-vbs add sd-vbs sd-vbs --- .../src/matlabPyrTools/pyrBandIndices.m | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/pyrBandIndices.m (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/pyrBandIndices.m') diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/pyrBandIndices.m b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/pyrBandIndices.m new file mode 100755 index 0000000..f94c217 --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/pyrBandIndices.m @@ -0,0 +1,24 @@ +% RES = pyrBandIndices(INDICES, BAND_NUM) +% +% Return indices for accessing a subband from a pyramid +% (gaussian, laplacian, QMF/wavelet, steerable). + +% Eero Simoncelli, 6/96. + +function indices = pyrBandIndices(pind,band) + +if ((band > size(pind,1)) | (band < 1)) + error(sprintf('BAND_NUM must be between 1 and number of pyramid bands (%d).', ... + size(pind,1))); +end + +if (size(pind,2) ~= 2) + error('INDICES must be an Nx2 matrix indicating the size of the pyramid subbands'); +end + +ind = 1; +for l=1:band-1 + ind = ind + prod(pind(l,:)); +end + +indices = ind:ind+prod(pind(band,:))-1; -- cgit v1.2.2