summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/cconv2.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/cconv2.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/cconv2.m50
1 files changed, 0 insertions, 50 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/cconv2.m b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/cconv2.m
deleted file mode 100755
index efba438..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/cconv2.m
+++ /dev/null
@@ -1,50 +0,0 @@
1% RES = CCONV2(MTX1, MTX2, CTR)
2%
3% Circular convolution of two matrices. Result will be of size of
4% 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
12
13% Eero Simoncelli, 6/96. Modified 2/97.
14
15function c = cconv2(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
40% pad:
41clarge = [ ...
42 large(ly-sy+sy2+1:ly,lx-sx+sx2+1:lx), large(ly-sy+sy2+1:ly,:), ...
43 large(ly-sy+sy2+1:ly,1:sx2-1); ...
44 large(:,lx-sx+sx2+1:lx), large, large(:,1:sx2-1); ...
45 large(1:sy2-1,lx-sx+sx2+1:lx), ...
46 large(1:sy2-1,:), ...
47 large(1:sy2-1,1:sx2-1) ];
48
49c = conv2(clarge,small,'valid');
50