diff options
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/cconv2.m')
| -rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlab/cconv2.m | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/cconv2.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/cconv2.m deleted file mode 100755 index efba438..0000000 --- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/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 | |||
| 15 | function c = cconv2(a,b,ctr) | ||
| 16 | |||
| 17 | if (exist('ctr') ~= 1) | ||
| 18 | ctr = 0; | ||
| 19 | end | ||
| 20 | |||
| 21 | if (( size(a,1) >= size(b,1) ) & ( size(a,2) >= size(b,2) )) | ||
| 22 | large = a; small = b; | ||
| 23 | elseif (( size(a,1) <= size(b,1) ) & ( size(a,2) <= size(b,2) )) | ||
| 24 | large = b; small = a; | ||
| 25 | else | ||
| 26 | error('one arg must be larger than the other in both dimensions!'); | ||
| 27 | end | ||
| 28 | |||
| 29 | ly = size(large,1); | ||
| 30 | lx = size(large,2); | ||
| 31 | sy = size(small,1); | ||
| 32 | sx = 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: | ||
| 37 | sy2 = floor((sy+ctr+1)/2); | ||
| 38 | sx2 = floor((sx+ctr+1)/2); | ||
| 39 | |||
| 40 | % pad: | ||
| 41 | clarge = [ ... | ||
| 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 | |||
| 49 | c = conv2(clarge,small,'valid'); | ||
| 50 | |||
