summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/blurDn.m
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2020-10-20 03:47:33 -0400
committerleochanj105 <leochanj@live.unc.edu>2020-10-20 03:47:33 -0400
commita32f220f06cc463e5b56e7fa0b1b1334d94d08f3 (patch)
tree4af4caa60074465d85fc2ef5cc1b23e74c064329 /SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/blurDn.m
parent79f30887129145e15e5172e36a7d7602859fc932 (diff)
matlab removed
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/blurDn.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/blurDn.m59
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
14function res = blurDn(im, nlevs, filt)
15
16%------------------------------------------------------------
17%% OPTIONAL ARGS:
18
19if (exist('nlevs') ~= 1)
20 nlevs = 1;
21end
22
23if (exist('filt') ~= 1)
24 filt = 'binom5';
25end
26
27%------------------------------------------------------------
28
29if isstr(filt)
30 filt = namedFilter(filt);
31end
32
33filt = filt/sum(filt(:));
34
35if nlevs > 1
36 im = blurDn(im,nlevs-1,filt);
37end
38
39if (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
57else
58 res = im;
59end