summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSpyr.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSpyr.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlab/reconSpyr.m96
1 files changed, 0 insertions, 96 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSpyr.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSpyr.m
deleted file mode 100755
index 270009d..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSpyr.m
+++ /dev/null
@@ -1,96 +0,0 @@
1% RES = reconSpyr(PYR, INDICES, FILTFILE, EDGES, LEVS, BANDS)
2%
3% Reconstruct image from its steerable pyramid representation, as created
4% by buildSpyr.
5%
6% PYR is a vector containing the N pyramid subbands, ordered from fine
7% to coarse. INDICES is an Nx2 matrix containing the sizes of
8% each subband. This is compatible with the MatLab Wavelet toolbox.
9%
10% FILTFILE (optional) should be a string referring to an m-file that returns
11% the rfilters. examples: sp0Filters, sp1Filters, sp3Filters
12% (default = 'sp1Filters').
13% EDGES specifies edge-handling, and defaults to 'reflect1' (see
14% corrDn).
15%
16% LEVS (optional) should be a list of levels to include, or the string
17% 'all' (default). 0 corresonds to the residual highpass subband.
18% 1 corresponds to the finest oriented scale. The lowpass band
19% corresponds to number spyrHt(INDICES)+1.
20%
21% BANDS (optional) should be a list of bands to include, or the string
22% 'all' (default). 1 = vertical, rest proceeding anti-clockwise.
23
24% Eero Simoncelli, 6/96.
25
26function res = reconSpyr(pyr, pind, filtfile, edges, levs, bands)
27
28%%------------------------------------------------------------
29%% DEFAULTS:
30
31if (exist('filtfile') ~= 1)
32 filtfile = 'sp1Filters';
33end
34
35if (exist('edges') ~= 1)
36 edges= 'reflect1';
37end
38
39if (exist('levs') ~= 1)
40 levs = 'all';
41end
42
43if (exist('bands') ~= 1)
44 bands = 'all';
45end
46
47%%------------------------------------------------------------
48
49if (isstr(filtfile) & (exist(filtfile) == 2))
50 [lo0filt,hi0filt,lofilt,bfilts,steermtx,harmonics] = eval(filtfile);
51 nbands = spyrNumBands(pind);
52 if ((nbands > 0) & (size(bfilts,2) ~= nbands))
53 error('Number of pyramid bands is inconsistent with filter file');
54 end
55else
56 error('filtfile argument must be the name of an M-file containing SPYR filters.');
57end
58
59maxLev = 1+spyrHt(pind);
60if strcmp(levs,'all')
61 levs = [0:maxLev]';
62else
63 if (any(levs > maxLev) | any(levs < 0))
64 error(sprintf('Level numbers must be in the range [0, %d].', maxLev));
65 end
66 levs = levs(:);
67end
68
69if strcmp(bands,'all')
70 bands = [1:nbands]';
71else
72 if (any(bands < 1) | any(bands > nbands))
73 error(sprintf('Band numbers must be in the range [1,3].', nbands));
74 end
75 bands = bands(:);
76end
77
78if (spyrHt(pind) == 0)
79 if (any(levs==1))
80 res1 = pyrBand(pyr,pind,2);
81 else
82 res1 = zeros(pind(2,:));
83 end
84else
85 res1 = reconSpyrLevs(pyr(1+prod(pind(1,:)):size(pyr,1)), ...
86 pind(2:size(pind,1),:), ...
87 lofilt, bfilts, edges, levs, bands);
88end
89
90res = upConv(res1, lo0filt, edges);
91
92%% residual highpass subband
93if any(levs == 0)
94 upConv( subMtx(pyr, pind(1,:)), hi0filt, edges, [1 1], [1 1], size(res), res);
95end
96