diff options
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSpyr.m')
-rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlab/reconSpyr.m | 96 |
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 | |||
26 | function res = reconSpyr(pyr, pind, filtfile, edges, levs, bands) | ||
27 | |||
28 | %%------------------------------------------------------------ | ||
29 | %% DEFAULTS: | ||
30 | |||
31 | if (exist('filtfile') ~= 1) | ||
32 | filtfile = 'sp1Filters'; | ||
33 | end | ||
34 | |||
35 | if (exist('edges') ~= 1) | ||
36 | edges= 'reflect1'; | ||
37 | end | ||
38 | |||
39 | if (exist('levs') ~= 1) | ||
40 | levs = 'all'; | ||
41 | end | ||
42 | |||
43 | if (exist('bands') ~= 1) | ||
44 | bands = 'all'; | ||
45 | end | ||
46 | |||
47 | %%------------------------------------------------------------ | ||
48 | |||
49 | if (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 | ||
55 | else | ||
56 | error('filtfile argument must be the name of an M-file containing SPYR filters.'); | ||
57 | end | ||
58 | |||
59 | maxLev = 1+spyrHt(pind); | ||
60 | if strcmp(levs,'all') | ||
61 | levs = [0:maxLev]'; | ||
62 | else | ||
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(:); | ||
67 | end | ||
68 | |||
69 | if strcmp(bands,'all') | ||
70 | bands = [1:nbands]'; | ||
71 | else | ||
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(:); | ||
76 | end | ||
77 | |||
78 | if (spyrHt(pind) == 0) | ||
79 | if (any(levs==1)) | ||
80 | res1 = pyrBand(pyr,pind,2); | ||
81 | else | ||
82 | res1 = zeros(pind(2,:)); | ||
83 | end | ||
84 | else | ||
85 | res1 = reconSpyrLevs(pyr(1+prod(pind(1,:)):size(pyr,1)), ... | ||
86 | pind(2:size(pind,1),:), ... | ||
87 | lofilt, bfilts, edges, levs, bands); | ||
88 | end | ||
89 | |||
90 | res = upConv(res1, lo0filt, edges); | ||
91 | |||
92 | %% residual highpass subband | ||
93 | if any(levs == 0) | ||
94 | upConv( subMtx(pyr, pind(1,:)), hi0filt, edges, [1 1], [1 1], size(res), res); | ||
95 | end | ||
96 | |||