diff options
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSFpyrLevs.m')
| -rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSFpyrLevs.m | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSFpyrLevs.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSFpyrLevs.m deleted file mode 100755 index 420f278..0000000 --- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSFpyrLevs.m +++ /dev/null | |||
| @@ -1,69 +0,0 @@ | |||
| 1 | % RESDFT = reconSFpyrLevs(PYR,INDICES,LOGRAD,XRCOS,YRCOS,ANGLE,NBANDS,LEVS,BANDS) | ||
| 2 | % | ||
| 3 | % Recursive function for reconstructing levels of a steerable pyramid | ||
| 4 | % representation. This is called by reconSFpyr, and is not usually | ||
| 5 | % called directly. | ||
| 6 | |||
| 7 | % Eero Simoncelli, 5/97. | ||
| 8 | |||
| 9 | function resdft = reconSFpyrLevs(pyr,pind,log_rad,Xrcos,Yrcos,angle,nbands,levs,bands); | ||
| 10 | |||
| 11 | lo_ind = nbands+1; | ||
| 12 | dims = pind(1,:); | ||
| 13 | ctr = ceil((dims+0.5)/2); | ||
| 14 | |||
| 15 | % log_rad = log_rad + 1; | ||
| 16 | Xrcos = Xrcos - log2(2); % shift origin of lut by 1 octave. | ||
| 17 | |||
| 18 | if any(levs > 1) | ||
| 19 | |||
| 20 | lodims = ceil((dims-0.5)/2); | ||
| 21 | loctr = ceil((lodims+0.5)/2); | ||
| 22 | lostart = ctr-loctr+1; | ||
| 23 | loend = lostart+lodims-1; | ||
| 24 | nlog_rad = log_rad(lostart(1):loend(1),lostart(2):loend(2)); | ||
| 25 | nangle = angle(lostart(1):loend(1),lostart(2):loend(2)); | ||
| 26 | |||
| 27 | if (size(pind,1) > lo_ind) | ||
| 28 | nresdft = reconSFpyrLevs( pyr(1+sum(prod(pind(1:lo_ind-1,:)')):size(pyr,1)),... | ||
| 29 | pind(lo_ind:size(pind,1),:), ... | ||
| 30 | nlog_rad, Xrcos, Yrcos, nangle, nbands,levs-1, bands); | ||
| 31 | else | ||
| 32 | nresdft = fftshift(fft2(pyrBand(pyr,pind,lo_ind))); | ||
| 33 | end | ||
| 34 | |||
| 35 | YIrcos = sqrt(abs(1.0 - Yrcos.^2)); | ||
| 36 | lomask = pointOp(nlog_rad, YIrcos, Xrcos(1), Xrcos(2)-Xrcos(1), 0); | ||
| 37 | |||
| 38 | resdft = zeros(dims); | ||
| 39 | resdft(lostart(1):loend(1),lostart(2):loend(2)) = nresdft .* lomask; | ||
| 40 | |||
| 41 | else | ||
| 42 | |||
| 43 | resdft = zeros(dims); | ||
| 44 | |||
| 45 | end | ||
| 46 | |||
| 47 | |||
| 48 | if any(levs == 1) | ||
| 49 | |||
| 50 | lutsize = 1024; | ||
| 51 | Xcosn = pi*[-(2*lutsize+1):(lutsize+1)]/lutsize; % [-2*pi:pi] | ||
| 52 | order = nbands-1; | ||
| 53 | %% divide by sqrt(sum_(n=0)^(N-1) cos(pi*n/N)^(2(N-1)) ) | ||
| 54 | const = (2^(2*order))*(factorial(order)^2)/(nbands*factorial(2*order)); | ||
| 55 | Ycosn = sqrt(const) * (cos(Xcosn)).^order; | ||
| 56 | himask = pointOp(log_rad, Yrcos, Xrcos(1), Xrcos(2)-Xrcos(1),0); | ||
| 57 | |||
| 58 | ind = 1; | ||
| 59 | for b = 1:nbands | ||
| 60 | if any(bands == b) | ||
| 61 | anglemask = pointOp(angle,Ycosn,Xcosn(1)+pi*(b-1)/nbands,Xcosn(2)-Xcosn(1)); | ||
| 62 | band = reshape(pyr(ind:ind+prod(dims)-1), dims(1), dims(2)); | ||
| 63 | banddft = fftshift(fft2(band)); | ||
| 64 | resdft = resdft + (sqrt(-1))^(nbands-1) * banddft.*anglemask.*himask; | ||
| 65 | end | ||
| 66 | ind = ind + prod(dims); | ||
| 67 | end | ||
| 68 | end | ||
| 69 | |||
