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/buildSpyrLevs.m | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/buildSpyrLevs.m (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/buildSpyrLevs.m') diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/buildSpyrLevs.m b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/buildSpyrLevs.m new file mode 100755 index 0000000..4c00077 --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/buildSpyrLevs.m @@ -0,0 +1,37 @@ +% [PYR, INDICES] = buildSpyrLevs(LOIM, HEIGHT, LOFILT, BFILTS, EDGES) +% +% Recursive function for constructing levels of a steerable pyramid. This +% is called by buildSpyr, and is not usually called directly. + +% Eero Simoncelli, 6/96. + +function [pyr,pind] = buildSpyrLevs(lo0,ht,lofilt,bfilts,edges); + +if (ht <= 0) + + pyr = lo0(:); + pind = size(lo0); + +else + + % Assume square filters: + bfiltsz = round(sqrt(size(bfilts,1))); + + bands = zeros(prod(size(lo0)),size(bfilts,2)); + bind = zeros(size(bfilts,2),2); + + for b = 1:size(bfilts,2) + filt = reshape(bfilts(:,b),bfiltsz,bfiltsz); + band = corrDn(lo0, filt, edges); + bands(:,b) = band(:); + bind(b,:) = size(band); + end + + lo = corrDn(lo0, lofilt, edges, [2 2], [1 1]); + + [npyr,nind] = buildSpyrLevs(lo, ht-1, lofilt, bfilts, edges); + + pyr = [bands(:); npyr]; + pind = [bind; nind]; + +end -- cgit v1.2.2