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/buildSCFpyrLevs.m | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/buildSCFpyrLevs.m (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/buildSCFpyrLevs.m') diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/buildSCFpyrLevs.m b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/buildSCFpyrLevs.m new file mode 100755 index 0000000..bd75695 --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/buildSCFpyrLevs.m @@ -0,0 +1,73 @@ +% [PYR, INDICES] = buildSCFpyrLevs(LODFT, LOGRAD, XRCOS, YRCOS, ANGLE, HEIGHT, NBANDS) +% +% Recursive function for constructing levels of a steerable pyramid. This +% is called by buildSCFpyr, and is not usually called directly. + +% Original code: Eero Simoncelli, 5/97. +% Modified by Javier Portilla to generate complex bands in 9/97. + +function [pyr,pind] = buildSCFpyrLevs(lodft,log_rad,Xrcos,Yrcos,angle,ht,nbands); + +if (ht <= 0) + + lo0 = ifft2(ifftshift(lodft)); + pyr = real(lo0(:)); + pind = size(lo0); + +else + + bands = zeros(prod(size(lodft)), nbands); + bind = zeros(nbands,2); + +% log_rad = log_rad + 1; + Xrcos = Xrcos - log2(2); % shift origin of lut by 1 octave. + + lutsize = 1024; + Xcosn = pi*[-(2*lutsize+1):(lutsize+1)]/lutsize; % [-2*pi:pi] + order = nbands-1; + %% divide by sqrt(sum_(n=0)^(N-1) cos(pi*n/N)^(2(N-1)) ) + %% Thanks to Patrick Teo for writing this out :) + const = (2^(2*order))*(factorial(order)^2)/(nbands*factorial(2*order)); + +% +% Ycosn = sqrt(const) * (cos(Xcosn)).^order; +% + % analityc version: only take one lobe + alfa= mod(pi+Xcosn,2*pi)-pi; + Ycosn = 2*sqrt(const) * (cos(Xcosn).^order) .* (abs(alfa)