diff options
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/shrink.m')
| -rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlab/shrink.m | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/shrink.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/shrink.m deleted file mode 100755 index 7af0151..0000000 --- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/shrink.m +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | function ts=shrink(t,f) | ||
| 2 | |||
| 3 | % It shrinks an image in a factor f | ||
| 4 | % in each dimension. | ||
| 5 | % ts = shrink(t,f) | ||
| 6 | % ts may also be complex. | ||
| 7 | % See also: expand.m, blurDn.m | ||
| 8 | % JPM, April 95, Instituto de Optica, CSIC, Madrid. | ||
| 9 | |||
| 10 | [my,mx]=size(t); | ||
| 11 | T=fftshift(fft2(t))/f^2; | ||
| 12 | Ts=zeros(my/f,mx/f); | ||
| 13 | y1=my/2+2-my/(2*f); | ||
| 14 | y2=my/2+my/(2*f); | ||
| 15 | x1=mx/2+2-mx/(2*f); | ||
| 16 | x2=mx/2+mx/(2*f); | ||
| 17 | Ts(2:my/f,2:mx/f)=T(y1:y2,x1:x2); | ||
| 18 | Ts(1,2:mx/f)=(T(y1-1,x1:x2)+T(y2+1,x1:x2))/2; | ||
| 19 | Ts(2:my/f,1)=(T(y1:y2,x1-1)+T(y1:y2,x2+1))/2; | ||
| 20 | Ts(1,1)=(T(y1-1,x1-1)+T(y1-1,x2+1)+T(y2+1,x1-1)+T(y2+1,x2+1))/4; | ||
| 21 | Ts=fftshift(Ts); | ||
| 22 | ts=ifft2(Ts); | ||
| 23 | if all(imag(t)==0), | ||
| 24 | ts = real(ts); | ||
| 25 | end | ||
