diff options
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/buildSCFpyrLevs.m')
-rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlab/buildSCFpyrLevs.m | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/buildSCFpyrLevs.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/buildSCFpyrLevs.m deleted file mode 100755 index bd75695..0000000 --- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/buildSCFpyrLevs.m +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | % [PYR, INDICES] = buildSCFpyrLevs(LODFT, LOGRAD, XRCOS, YRCOS, ANGLE, HEIGHT, NBANDS) | ||
2 | % | ||
3 | % Recursive function for constructing levels of a steerable pyramid. This | ||
4 | % is called by buildSCFpyr, and is not usually called directly. | ||
5 | |||
6 | % Original code: Eero Simoncelli, 5/97. | ||
7 | % Modified by Javier Portilla to generate complex bands in 9/97. | ||
8 | |||
9 | function [pyr,pind] = buildSCFpyrLevs(lodft,log_rad,Xrcos,Yrcos,angle,ht,nbands); | ||
10 | |||
11 | if (ht <= 0) | ||
12 | |||
13 | lo0 = ifft2(ifftshift(lodft)); | ||
14 | pyr = real(lo0(:)); | ||
15 | pind = size(lo0); | ||
16 | |||
17 | else | ||
18 | |||
19 | bands = zeros(prod(size(lodft)), nbands); | ||
20 | bind = zeros(nbands,2); | ||
21 | |||
22 | % log_rad = log_rad + 1; | ||
23 | Xrcos = Xrcos - log2(2); % shift origin of lut by 1 octave. | ||
24 | |||
25 | lutsize = 1024; | ||
26 | Xcosn = pi*[-(2*lutsize+1):(lutsize+1)]/lutsize; % [-2*pi:pi] | ||
27 | order = nbands-1; | ||
28 | %% divide by sqrt(sum_(n=0)^(N-1) cos(pi*n/N)^(2(N-1)) ) | ||
29 | %% Thanks to Patrick Teo for writing this out :) | ||
30 | const = (2^(2*order))*(factorial(order)^2)/(nbands*factorial(2*order)); | ||
31 | |||
32 | % | ||
33 | % Ycosn = sqrt(const) * (cos(Xcosn)).^order; | ||
34 | % | ||
35 | % analityc version: only take one lobe | ||
36 | alfa= mod(pi+Xcosn,2*pi)-pi; | ||
37 | Ycosn = 2*sqrt(const) * (cos(Xcosn).^order) .* (abs(alfa)<pi/2); | ||
38 | |||
39 | himask = pointOp(log_rad, Yrcos, Xrcos(1), Xrcos(2)-Xrcos(1), 0); | ||
40 | |||
41 | for b = 1:nbands | ||
42 | anglemask = pointOp(angle, Ycosn, Xcosn(1)+pi*(b-1)/nbands, Xcosn(2)-Xcosn(1)); | ||
43 | banddft = ((-i)^(nbands-1)) .* lodft .* anglemask .* himask; | ||
44 | band = ifft2(ifftshift(banddft)); | ||
45 | |||
46 | % bands(:,b) = real(band(:)); | ||
47 | % analytic version: full complex value | ||
48 | bands(:,b)=band(:); | ||
49 | bind(b,:) = size(band); | ||
50 | end | ||
51 | |||
52 | dims = size(lodft); | ||
53 | ctr = ceil((dims+0.5)/2); | ||
54 | lodims = ceil((dims-0.5)/2); | ||
55 | loctr = ceil((lodims+0.5)/2); | ||
56 | lostart = ctr-loctr+1; | ||
57 | loend = lostart+lodims-1; | ||
58 | |||
59 | log_rad = log_rad(lostart(1):loend(1),lostart(2):loend(2)); | ||
60 | angle = angle(lostart(1):loend(1),lostart(2):loend(2)); | ||
61 | lodft = lodft(lostart(1):loend(1),lostart(2):loend(2)); | ||
62 | YIrcos = abs(sqrt(1.0 - Yrcos.^2)); | ||
63 | lomask = pointOp(log_rad, YIrcos, Xrcos(1), Xrcos(2)-Xrcos(1), 0); | ||
64 | |||
65 | lodft = lomask .* lodft; | ||
66 | |||
67 | [npyr,nind] = buildSCFpyrLevs(lodft, log_rad, Xrcos, Yrcos, angle, ht-1, nbands); | ||
68 | |||
69 | pyr = [bands(:); npyr]; | ||
70 | pind = [bind; nind]; | ||
71 | |||
72 | end | ||
73 | |||