summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS
diff options
context:
space:
mode:
authorleochanj <jbakita@cs.unc.edu>2020-10-21 01:52:54 -0400
committerleochanj <jbakita@cs.unc.edu>2020-10-21 01:52:54 -0400
commit25d94aa8aabb8ac3e8bbea0bc439ea6148444cc8 (patch)
treeba80e76d25d9ca9486092e2f6b6d76f0e3352bf7 /SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS
parente2b50015cebdfba68699abd6e8575e38230f5a78 (diff)
debug libextra and remove matlab
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS/README18
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS/matlabPyrTools.m145
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS/pyramids.m903
3 files changed, 0 insertions, 1066 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS/README b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS/README
deleted file mode 100755
index 06960a4..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS/README
+++ /dev/null
@@ -1,18 +0,0 @@
1
2This directory contains some Matlab script files that serve to give
3example usage of this code, and also to explain some of the
4representations and algorithms.
5
6The files are NOT meant to be executed from the MatLab prompt (like many
7of the MatLab demos). You should instead read through the comments,
8executing the subsequent pieces of code. This gives you a chance to
9explore as you go...
10
11matlabPyrTools.m - Example usage of the code in the distribution.
12
13pyramids.m - An introduction to multi-scale pyramid representations,
14 covering Laplacian, QMF/Wavelet, and Steerable pyramids. The
15 file assumes a knowledge of linear systems, matrix algebra,
16 and 2D Fourier transforms.
17
18more to come....
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS/matlabPyrTools.m b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS/matlabPyrTools.m
deleted file mode 100755
index 44c27ce..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/TUTORIALS/matlabPyrTools.m
+++ /dev/null
@@ -1,145 +0,0 @@
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%%% Some examples using the tools in this distribution.
3%%% Eero Simoncelli, 2/97.
4%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6%% Add directory to path (YOU'LL NEED TO ADJUST THIS):
7path('/lcv/matlab/lib/matlabPyrTools',path);
8
9%% Load an image, and downsample to a size appropriate for the machine speed.
10oim = pgmRead('einstein.pgm');
11tic; corrDn(oim,[1 1; 1 1]/4,'reflect1',[2 2]); time = toc;
12imSubSample = min(max(floor(log2(time)/2+3),0),2);
13im = blurDn(oim, imSubSample,'qmf9');
14clear oim;
15
16%%% ShowIm:
17%% 3 types of automatic graylevel scaling, 2 types of automatic
18%% sizing, with or without title and Range information.
19help showIm
20clf; showIm(im,'auto1','auto','Al')
21clf; showIm('im','auto2')
22clf; showIm(im,'auto3',2)
23
24%%% Statistics:
25mean2(im)
26var2(im)
27skew2(im)
28kurt2(im)
29entropy2(im)
30imStats(im)
31
32%%% Synthetic images. First pick some parameters:
33sz = 200;
34dir = 2*pi*rand(1)
35slope = 10*rand(1)-5
36int = 10*rand(1)-5;
37orig = round(1+(sz-1)*rand(2,1));
38expt = 0.8+rand(1)
39ampl = 1+5*rand(1)
40ph = 2*pi*rand(1)
41per = 20
42twidth = 7
43
44clf;
45showIm(mkRamp(sz,dir,slope,int,orig));
46showIm(mkImpulse(sz,orig,ampl));
47showIm(mkR(sz,expt,orig));
48showIm(mkAngle(sz,dir));
49showIm(mkDisc(sz,sz/4,orig,twidth));
50showIm(mkGaussian(sz,(sz/6)^2,orig,ampl));
51showIm(mkZonePlate(sz,ampl,ph));
52showIm(mkAngularSine(sz,3,ampl,ph,orig));
53showIm(mkSine(sz,per,dir,ampl,ph,orig));
54showIm(mkSquare(sz,per,dir,ampl,ph,orig,twidth));
55showIm(mkFract(sz,expt));
56
57
58%%% Point operations (lookup tables):
59[Xtbl,Ytbl] = rcosFn(20, 25, [-1 1]);
60plot(Xtbl,Ytbl);
61showIm(pointOp(mkR(100,1,[70,30]), Ytbl, Xtbl(1), Xtbl(2)-Xtbl(1), 0));
62
63
64%%% histogram Modification/matching:
65[N,X] = histo(im, 150);
66[mn, mx] = range2(im);
67matched = histoMatch(rand(size(im)), N, X);
68showIm(im + sqrt(-1)*matched);
69[Nm,Xm] = histo(matched,150);
70nextFig(2,1);
71 subplot(1,2,1); plot(X,N); axis([mn mx 0 max(N)]);
72 subplot(1,2,2); plot(Xm,Nm); axis([mn mx 0 max(N)]);
73nextFig(2,-1);
74
75%%% Convolution routines:
76
77%% Compare speed of convolution/downsampling routines:
78noise = rand(400); filt = rand(10);
79tic; res1 = corrDn(noise,filt(10:-1:1,10:-1:1),'reflect1',[2 2]); toc;
80tic; ires = rconv2(noise,filt); res2 = ires(1:2:400,1:2:400); toc;
81imStats(res1,res2)
82
83%% Display image and extension of left and top boundaries:
84fsz = [9 9];
85fmid = ceil((fsz+1)/2);
86imsz = [16 16];
87
88% pick one:
89im = eye(imsz);
90im = mkRamp(imsz,pi/6);
91im = mkSquare(imsz,6,pi/6);
92
93% pick one:
94edges='reflect1';
95edges='reflect2';
96edges='repeat';
97edges='extend';
98edges='zero';
99edges='circular';
100edges='dont-compute';
101
102filt = mkImpulse(fsz,[1 1]);
103showIm(corrDn(im,filt,edges));
104line([0,0,imsz(2),imsz(2),0]+fmid(2)-0.5, ...
105 [0,imsz(1),imsz(1),0,0]+fmid(1)-0.5);
106title(sprintf('Edges = %s',edges));
107
108%%% Multi-scale pyramids (see pyramids.m for more examples,
109%%% and explanations):
110
111%% A Laplacian pyramid:
112[pyr,pind] = buildLpyr(im);
113showLpyr(pyr,pind);
114
115res = reconLpyr(pyr, pind); % full reconstruction
116imStats(im,res); % essentially perfect
117
118res = reconLpyr(pyr, pind, [2 3]); %reconstruct 2nd and 3rd levels only
119showIm(res);
120
121%% Wavelet/QMF pyramids:
122filt = 'qmf9'; edges = 'reflect1';
123filt = 'haar'; edges = 'qreflect2';
124filt = 'qmf12'; edges = 'qreflect2';
125filt = 'daub3'; edges = 'circular';
126
127[pyr,pind] = buildWpyr(im, 5-imSubSample, filt, edges);
128showWpyr(pyr,pind,'auto2');
129
130res = reconWpyr(pyr, pind, filt, edges);
131clf; showIm(im + i*res);
132imStats(im,res);
133
134res = reconWpyr(pyr, pind, filt, edges, 'all', [2]); %vertical only
135clf; showIm(res);
136
137%% Steerable pyramid:
138[pyr,pind] = buildSpyr(im,4-imSubSample,'sp3Filters');
139showSpyr(pyr,pind);
140
141%% Steerable pyramid, constructed in frequency domain:
142[pyr,pind] = buildSFpyr(im,5-imSubSample,4); %5 orientation bands
143showSpyr(pyr,pind);
144res = reconSFpyr(pyr,pind);
145imStats(im,res);