summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlab/zconv2.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/zconv2.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlab/zconv2.m41
1 files changed, 0 insertions, 41 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/zconv2.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/zconv2.m
deleted file mode 100755
index f678d89..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/zconv2.m
+++ /dev/null
@@ -1,41 +0,0 @@
1% RES = ZCONV2(MTX1, MTX2, CTR)
2%
3% Convolution of two matrices, with boundaries handled as if the larger mtx
4% lies in a sea of zeros. Result will be of size of LARGER vector.
5%
6% The origin of the smaller matrix is assumed to be its center.
7% For even dimensions, the origin is determined by the CTR (optional)
8% argument:
9% CTR origin
10% 0 DIM/2 (default)
11% 1 (DIM/2)+1 (behaves like conv2(mtx1,mtx2,'same'))
12
13% Eero Simoncelli, 2/97.
14
15function c = zconv2(a,b,ctr)
16
17if (exist('ctr') ~= 1)
18 ctr = 0;
19end
20
21if (( size(a,1) >= size(b,1) ) & ( size(a,2) >= size(b,2) ))
22 large = a; small = b;
23elseif (( size(a,1) <= size(b,1) ) & ( size(a,2) <= size(b,2) ))
24 large = b; small = a;
25else
26 error('one arg must be larger than the other in both dimensions!');
27end
28
29ly = size(large,1);
30lx = size(large,2);
31sy = size(small,1);
32sx = size(small,2);
33
34%% These values are the index of the small mtx that falls on the
35%% border pixel of the large matrix when computing the first
36%% convolution response sample:
37sy2 = floor((sy+ctr+1)/2);
38sx2 = floor((sx+ctr+1)/2);
39
40clarge = conv2(large,small);
41c = clarge(sy2:ly+sy2-1, sx2:lx+sx2-1);