diff options
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/blurDn.m')
-rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/blurDn.m | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/blurDn.m b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/blurDn.m deleted file mode 100755 index 8120c04..0000000 --- a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/blurDn.m +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | % RES = blurDn(IM, LEVELS, FILT) | ||
2 | % | ||
3 | % Blur and downsample an image. The blurring is done with filter | ||
4 | % kernel specified by FILT (default = 'binom5'), which can be a string | ||
5 | % (to be passed to namedFilter), a vector (applied separably as a 1D | ||
6 | % convolution kernel in X and Y), or a matrix (applied as a 2D | ||
7 | % convolution kernel). The downsampling is always by 2 in each | ||
8 | % direction. | ||
9 | % | ||
10 | % The procedure is applied recursively LEVELS times (default=1). | ||
11 | |||
12 | % Eero Simoncelli, 3/97. | ||
13 | |||
14 | function res = blurDn(im, nlevs, filt) | ||
15 | |||
16 | %------------------------------------------------------------ | ||
17 | %% OPTIONAL ARGS: | ||
18 | |||
19 | if (exist('nlevs') ~= 1) | ||
20 | nlevs = 1; | ||
21 | end | ||
22 | |||
23 | if (exist('filt') ~= 1) | ||
24 | filt = 'binom5'; | ||
25 | end | ||
26 | |||
27 | %------------------------------------------------------------ | ||
28 | |||
29 | if isstr(filt) | ||
30 | filt = namedFilter(filt); | ||
31 | end | ||
32 | |||
33 | filt = filt/sum(filt(:)); | ||
34 | |||
35 | if nlevs > 1 | ||
36 | im = blurDn(im,nlevs-1,filt); | ||
37 | end | ||
38 | |||
39 | if (nlevs >= 1) | ||
40 | if (any(size(im)==1)) | ||
41 | if (~any(size(filt)==1)) | ||
42 | error('Cant apply 2D filter to 1D signal'); | ||
43 | end | ||
44 | if (size(im,2)==1) | ||
45 | filt = filt(:); | ||
46 | else | ||
47 | filt = filt(:)'; | ||
48 | end | ||
49 | res = corrDn(im,filt,'reflect1',(size(im)~=1)+1); | ||
50 | elseif (any(size(filt)==1)) | ||
51 | filt = filt(:); | ||
52 | res = corrDn(im,filt,'reflect1',[2 1]); | ||
53 | res = corrDn(res,filt','reflect1',[1 2]); | ||
54 | else | ||
55 | res = corrDn(im,filt,'reflect1',[2 2]); | ||
56 | end | ||
57 | else | ||
58 | res = im; | ||
59 | end | ||