summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib/mosaic.m
diff options
context:
space:
mode:
authorLeo Chan <leochanj@live.unc.edu>2020-10-22 01:53:21 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2020-10-22 01:56:35 -0400
commitd17b33131c14864bd1eae275f49a3f148e21cf29 (patch)
tree0d8f77922e8d193cb0f6edab83018f057aad64a0 /SD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib/mosaic.m
parent601ed25a4c5b66cb75315832c15613a727db2c26 (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/TOOLBOX_calib/mosaic.m')
-rwxr-xr-xSD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib/mosaic.m92
1 files changed, 92 insertions, 0 deletions
diff --git a/SD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib/mosaic.m b/SD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib/mosaic.m
new file mode 100755
index 0000000..b056661
--- /dev/null
+++ b/SD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib/mosaic.m
@@ -0,0 +1,92 @@
1
2if ~exist('I_1'),
3 active_images_save = active_images;
4 ima_read_calib;
5 active_images = active_images_save;
6 check_active_images;
7end;
8
9check_active_images;
10
11if isempty(ind_read),
12 return;
13end;
14
15
16n_col = floor(sqrt(n_ima*nx/ny));
17
18n_row = ceil(n_ima / n_col);
19
20
21ker2 = 1;
22for ii = 1:n_col,
23 ker2 = conv(ker2,[1/4 1/2 1/4]);
24end;
25
26
27II = I_1(1:n_col:end,1:n_col:end);
28
29[ny2,nx2] = size(II);
30
31
32
33kk_c = 1;
34
35II_mosaic = [];
36
37for jj = 1:n_row,
38
39
40 II_row = [];
41
42 for ii = 1:n_col,
43
44 if (exist(['I_' num2str(kk_c)])) & (kk_c <= n_ima),
45
46 if active_images(kk_c),
47 eval(['I = I_' num2str(kk_c) ';']);
48 %I = conv2(conv2(I,ker2,'same'),ker2','same'); % anti-aliasing
49 I = I(1:n_col:end,1:n_col:end);
50 else
51 I = zeros(ny2,nx2);
52 end;
53
54 else
55
56 I = zeros(ny2,nx2);
57
58 end;
59
60
61
62 II_row = [II_row I];
63
64 if ii ~= n_col,
65
66 II_row = [II_row zeros(ny2,3)];
67
68 end;
69
70
71 kk_c = kk_c + 1;
72
73 end;
74
75 nn2 = size(II_row,2);
76
77 if jj ~= n_row,
78 II_row = [II_row; zeros(3,nn2)];
79 end;
80
81 II_mosaic = [II_mosaic ; II_row];
82
83end;
84
85figure(2);
86image(II_mosaic);
87colormap(gray(256));
88title('Calibration images');
89set(gca,'Xtick',[])
90set(gca,'Ytick',[])
91axis('image');
92