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/setPyrBand.m | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/setPyrBand.m (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/setPyrBand.m') diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/setPyrBand.m b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/setPyrBand.m new file mode 100755 index 0000000..baa9f77 --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/setPyrBand.m @@ -0,0 +1,32 @@ +% NEWPYR = setPyrBand(PYR, INDICES, BAND, BAND_NUM) +% +% Insert an image (BAND) into a pyramid (gaussian, laplacian, QMF/wavelet, +% or steerable). Subbands are numbered consecutively, from finest +% (highest spatial frequency) to coarsest (lowest spatial frequency). + +% Eero Simoncelli, 1/03. + +function pyr = pyrBand(pyr, pind, band, bandNum) + +%% Check: PIND a valid index matrix? +if ( ~(ndims(pind) == 2) | ~(size(pind,2) == 2) | ~all(pind==round(pind)) ) + pind + error('pyrTools:badArg',... + 'PIND argument is not an Nbands X 2 matrix of integers'); +end + +%% Check: PIND consistent with size of PYR? +if ( length(pyr) ~= sum(prod(pind,2)) ) + error('pyrTools:badPyr',... + 'Pyramid data vector length is inconsistent with index matrix PIND'); +end + +%% Check: size of BAND consistent with desired BANDNUM? +if (~all(size(band) == pind(bandNum,:))) + size(band) + pind(bandNum,:) + error('pyrTools:badArg',... + 'size of BAND to be inserted is inconsistent with BAND_NUM'); +end + +pyr(pyrBandIndices(pind,bandNum)) = vectify(band); -- cgit v1.2.2