diff options
author | Leo Chan <leochanj@live.unc.edu> | 2020-10-22 01:53:21 -0400 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-22 01:56:35 -0400 |
commit | d17b33131c14864bd1eae275f49a3f148e21cf29 (patch) | |
tree | 0d8f77922e8d193cb0f6edab83018f057aad64a0 /SD-VBS/common/toolbox/toolbox_basic/pyramid | |
parent | 601ed25a4c5b66cb75315832c15613a727db2c26 (diff) |
Squashed commit of the sb-vbs branch.
Includes the SD-VBS benchmarks modified to:
- Use libextra to loop as realtime jobs
- Preallocate memory before starting their main computation
- Accept input via stdin instead of via argc
Does not include the SD-VBS matlab code.
Fixes libextra execution in LITMUS^RT.
Diffstat (limited to 'SD-VBS/common/toolbox/toolbox_basic/pyramid')
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/pyramid/091399fbn-jets.3.jpg | bin | 0 -> 25886 bytes | |||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/pyramid/expand.m | 8 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/pyramid/gauss_lowpass.m | 9 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/pyramid/gen_w.m | 12 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/pyramid/reduce.m | 7 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/pyramid/session.m | 26 | ||||
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/pyramid/startup.m | 5 |
7 files changed, 67 insertions, 0 deletions
diff --git a/SD-VBS/common/toolbox/toolbox_basic/pyramid/091399fbn-jets.3.jpg b/SD-VBS/common/toolbox/toolbox_basic/pyramid/091399fbn-jets.3.jpg new file mode 100755 index 0000000..b91732f --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/pyramid/091399fbn-jets.3.jpg | |||
Binary files differ | |||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/pyramid/expand.m b/SD-VBS/common/toolbox/toolbox_basic/pyramid/expand.m new file mode 100755 index 0000000..64e9fda --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/pyramid/expand.m | |||
@@ -0,0 +1,8 @@ | |||
1 | function J = expand(I) | ||
2 | % | ||
3 | % | ||
4 | |||
5 | [sy,sx] = size(I); | ||
6 | [x,y] = meshgrid(1:2*sx+1,1:2*sy+1); | ||
7 | |||
8 | nx = \ No newline at end of file | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/pyramid/gauss_lowpass.m b/SD-VBS/common/toolbox/toolbox_basic/pyramid/gauss_lowpass.m new file mode 100755 index 0000000..87ad4f1 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/pyramid/gauss_lowpass.m | |||
@@ -0,0 +1,9 @@ | |||
1 | function J = gauss_lowpass(I,a) | ||
2 | |||
3 | if (nargin < 2), | ||
4 | a = 0.4; | ||
5 | end | ||
6 | |||
7 | w = gen_w(a); | ||
8 | |||
9 | J = conv2(conv2(I,w,'same'),w','same'); | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/pyramid/gen_w.m b/SD-VBS/common/toolbox/toolbox_basic/pyramid/gen_w.m new file mode 100755 index 0000000..b255751 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/pyramid/gen_w.m | |||
@@ -0,0 +1,12 @@ | |||
1 | function w = gen_w(a) | ||
2 | % | ||
3 | |||
4 | if (nargin == 0), | ||
5 | a = 0.4; | ||
6 | end | ||
7 | |||
8 | w(3) = a; | ||
9 | w(1) = 1/4 - a/2; | ||
10 | w(5) = 1/4 - a/2; | ||
11 | w(2) = 1/4; | ||
12 | w(4) = 1/4; | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/pyramid/reduce.m b/SD-VBS/common/toolbox/toolbox_basic/pyramid/reduce.m new file mode 100755 index 0000000..6837e8a --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/pyramid/reduce.m | |||
@@ -0,0 +1,7 @@ | |||
1 | function J = reduce(I) | ||
2 | |||
3 | [nr,nc,nb] = size(I); | ||
4 | for j=1:nb, | ||
5 | tmp = gauss_lowpass(I(:,:,j)); | ||
6 | J(:,:,j) = tmp(1:2:nr,1:2:nc); | ||
7 | end \ No newline at end of file | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/pyramid/session.m b/SD-VBS/common/toolbox/toolbox_basic/pyramid/session.m new file mode 100755 index 0000000..9d0aa6c --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/pyramid/session.m | |||
@@ -0,0 +1,26 @@ | |||
1 | %image_dir = '/home/barad-dur/d/malik/jshi/'; | ||
2 | %I = gifread([image_dir,'tape9/t9a1_L.40.gif']); | ||
3 | I = pgmread('car100x100_0001'); | ||
4 | Io = I; | ||
5 | |||
6 | B = []; | ||
7 | |||
8 | done = 0; | ||
9 | st = 2; | ||
10 | sz = size(I); | ||
11 | while (~done), | ||
12 | w = max(1,round(0.05*size(I,1))); | ||
13 | b = zeros(round(0.5*size(Io)),round(0.5*size(I))); | ||
14 | %J = smooth(I,w); | ||
15 | %I = J(1:st:size(J,1),1:st:size(J,2)); | ||
16 | I = reduce(I); | ||
17 | sz = [sz;size(I)]; | ||
18 | b(1:size(I,1),1:size(I,2)) = I; | ||
19 | disp(int2str(size(I,1))); | ||
20 | |||
21 | B = [B,b]; | ||
22 | |||
23 | if (size(I,1) < 8), | ||
24 | done = 1; | ||
25 | end | ||
26 | end | ||
diff --git a/SD-VBS/common/toolbox/toolbox_basic/pyramid/startup.m b/SD-VBS/common/toolbox/toolbox_basic/pyramid/startup.m new file mode 100755 index 0000000..f86f9f4 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/pyramid/startup.m | |||
@@ -0,0 +1,5 @@ | |||
1 | home_dir = '/home/nef0/malik/jshi/jshi/matlab/'; | ||
2 | path([home_dir,'toolbox/io'], path) | ||
3 | path([home_dir,'toolbox/filter'],path) | ||
4 | path(path,[home_dir,'vision/vision94/tracking/']) | ||
5 | clear home_dir \ No newline at end of file | ||