summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/mkFract.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/mkFract.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/mkFract.m36
1 files changed, 0 insertions, 36 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/mkFract.m b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/mkFract.m
deleted file mode 100755
index af95cd5..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/mkFract.m
+++ /dev/null
@@ -1,36 +0,0 @@
1% IM = mkFract(SIZE, FRACT_DIM)
2%
3% Make a matrix of dimensions SIZE (a [Y X] 2-vector, or a scalar)
4% containing fractal (pink) noise with power spectral density of the
5% form: 1/f^(5-2*FRACT_DIM). Image variance is normalized to 1.0.
6% FRACT_DIM defaults to 1.0
7
8% Eero Simoncelli, 6/96.
9
10%% TODO: Verify that this matches Mandelbrot defn of fractal dimension.
11%% Make this more efficient!
12
13function res = mkFract(dims, fract_dim)
14
15if (exist('fract_dim') ~= 1)
16 fract_dim = 1.0;
17end
18
19res = randn(dims);
20fres = fft2(res);
21
22sz = size(res);
23ctr = ceil((sz+1)./2);
24
25shape = ifftshift(mkR(sz, -(2.5-fract_dim), ctr));
26shape(1,1) = 1; %%DC term
27
28fres = shape .* fres;
29fres = ifft2(fres);
30
31if (max(max(abs(imag(fres)))) > 1e-10)
32 error('Symmetry error in creating fractal');
33else
34 res = real(fres);
35 res = res / sqrt(var2(res));
36end