summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/upConv.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/upConv.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/upConv.m80
1 files changed, 0 insertions, 80 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/upConv.m b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/upConv.m
deleted file mode 100755
index 4d1ffd9..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/upConv.m
+++ /dev/null
@@ -1,80 +0,0 @@
1% RES = upConv(IM, FILT, EDGES, STEP, START, STOP, RES)
2%
3% Upsample matrix IM, followed by convolution with matrix FILT. These
4% arguments should be 1D or 2D matrices, and IM must be larger (in
5% both dimensions) than FILT. The origin of filt
6% is assumed to be floor(size(filt)/2)+1.
7%
8% EDGES is a string determining boundary handling:
9% 'circular' - Circular convolution
10% 'reflect1' - Reflect about the edge pixels
11% 'reflect2' - Reflect, doubling the edge pixels
12% 'repeat' - Repeat the edge pixels
13% 'zero' - Assume values of zero outside image boundary
14% 'extend' - Reflect and invert
15% 'dont-compute' - Zero output when filter overhangs OUTPUT boundaries
16%
17% Upsampling factors are determined by STEP (optional, default=[1 1]),
18% a 2-vector [y,x].
19%
20% The window over which the convolution occurs is specfied by START
21% (optional, default=[1,1], and STOP (optional, default =
22% step .* (size(IM) + floor((start-1)./step))).
23%
24% RES is an optional result matrix. The convolution result will be
25% destructively added into this matrix. If this argument is passed, the
26% result matrix will not be returned. DO NOT USE THIS ARGUMENT IF
27% YOU DO NOT UNDERSTAND WHAT THIS MEANS!!
28%
29% NOTE: this operation corresponds to multiplication of a signal
30% vector by a matrix whose columns contain copies of the time-reversed
31% (or space-reversed) FILT shifted by multiples of STEP. See corrDn.m
32% for the operation corresponding to the transpose of this matrix.
33
34% Eero Simoncelli, 6/96. revised 2/97.
35
36function result = upConv(im,filt,edges,step,start,stop,res)
37
38%% THIS CODE IS NOT ACTUALLY USED! (MEX FILE IS CALLED INSTEAD)
39
40fprintf(1,'WARNING: You should compile the MEX version of "upConv.c",\n found in the MEX subdirectory of matlabPyrTools, and put it in your matlab path. It is MUCH faster, and provides more boundary-handling options.\n');
41
42%------------------------------------------------------------
43%% OPTIONAL ARGS:
44
45if (exist('edges') == 1)
46 if (strcmp(edges,'reflect1') ~= 1)
47 warning('Using REFLECT1 edge-handling (use MEX code for other options).');
48 end
49end
50
51if (exist('step') ~= 1)
52 step = [1,1];
53end
54
55if (exist('start') ~= 1)
56 start = [1,1];
57end
58
59% A multiple of step
60if (exist('stop') ~= 1)
61 stop = step .* (floor((start-ones(size(start)))./step)+size(im))
62end
63
64if ( ceil((stop(1)+1-start(1)) / step(1)) ~= size(im,1) )
65 error('Bad Y result dimension');
66end
67if ( ceil((stop(2)+1-start(2)) / step(2)) ~= size(im,2) )
68 error('Bad X result dimension');
69end
70
71if (exist('res') ~= 1)
72 res = zeros(stop-start+1);
73end
74
75%------------------------------------------------------------
76
77tmp = zeros(size(res));
78tmp(start(1):step(1):stop(1),start(2):step(2):stop(2)) = im;
79
80result = rconv2(tmp,filt) + res;