summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/toolbox/toolbox_basic/calib_bouguetj/calib.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/calib_bouguetj/calib.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/calib_bouguetj/calib.m')
-rwxr-xr-xSD-VBS/common/toolbox/toolbox_basic/calib_bouguetj/calib.m74
1 files changed, 74 insertions, 0 deletions
diff --git a/SD-VBS/common/toolbox/toolbox_basic/calib_bouguetj/calib.m b/SD-VBS/common/toolbox/toolbox_basic/calib_bouguetj/calib.m
new file mode 100755
index 0000000..5b0fdac
--- /dev/null
+++ b/SD-VBS/common/toolbox/toolbox_basic/calib_bouguetj/calib.m
@@ -0,0 +1,74 @@
1if ~exist('instructions'), instructions = 1; end;
2
3if instructions,
4
5fprintf(1,'\n');
6fprintf(1,'*----------------------------------------------------------------------------------------------------*\n');
7fprintf(1,'| Main Calibration toolbox (2D and 3D rigs) |\n');
8fprintf(1,'| (c) Jean-Yves Bouguet - September 9th, 1999 |\n');
9fprintf(1,'*----------------------------------------------------------------------------------------------------*\n\n\n');
10
11fprintf(1,'CLICK ON:\n\n');
12
13fprintf(1,'2D: To perform camera calibration from multiple views of a 2D planar grid. \n');
14fprintf(1,' Set default size of grid (in dX_default and dY_default) in click_calib.m.\n');
15fprintf(1,'3D: To perform camera calibration from multiple views of a 3D grid corner. \n');
16fprintf(1,' Set default size of grids (in dX_default and dY_default) in click_calib3D.m.\n');
17fprintf(1,'Exit: To close the calibration tool. \n');
18
19end;
20
21instructions = 0;
22
23fig_number = 1;
24
25n_row = 1;
26n_col = 3;
27
28string_list = cell(n_row,n_col);
29callback_list = cell(n_row,n_col);
30
31x_size = 40;
32y_size = 20;
33
34title_figure = 'Calibration tool';
35
36string_list{1,1} = '2D rig';
37string_list{1,2} = '3D rig';
38string_list{1,3} = 'Exit';
39
40callback_list{1,1} = 'calib_gui;';
41callback_list{1,2} = 'calib3D_gui;';
42callback_list{1,3} = ['disp(''Bye. To run again, type calib.''); close(' num2str(fig_number) ');'];
43
44
45figure(fig_number); clf;
46pos = get(fig_number,'Position');
47
48fig_size_x = x_size*n_col+(n_col+1)*2;
49fig_size_y = y_size*n_row+(n_row+1)*2;
50
51set(fig_number,'Units','points', ...
52 'BackingStore','off', ...
53 'Color',[0.8 0.8 0.8], ...
54 'MenuBar','none', ...
55 'Resize','off', ...
56 'Name',title_figure, ...
57'Position',[pos(1) pos(2) fig_size_x fig_size_y], ...
58'NumberTitle','off');
59
60
61for i=n_row:-1:1,
62 for j = n_col:-1:1,
63 if (~isempty(callback_list{i,j}))&(~isempty(string_list{i,j})),
64 uicontrol('Parent',fig_number, ...
65 'Units','points', ...
66 'Callback',callback_list{i,j}, ...
67 'ListboxTop',0, ...
68 'Position',[(2+(j-1)*(x_size+2)) (fig_size_y - i*(2+y_size)) x_size y_size], ...
69 'String',string_list{i,j}, ...
70 'Tag','Pushbutton1');
71 end;
72 end;
73end;
74