From d17b33131c14864bd1eae275f49a3f148e21cf29 Mon Sep 17 00:00:00 2001 From: Leo Chan Date: Thu, 22 Oct 2020 01:53:21 -0400 Subject: 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. --- .../toolbox/toolbox_basic/calib_bouguetj/calib.m | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100755 SD-VBS/common/toolbox/toolbox_basic/calib_bouguetj/calib.m (limited to 'SD-VBS/common/toolbox/toolbox_basic/calib_bouguetj/calib.m') 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 @@ +if ~exist('instructions'), instructions = 1; end; + +if instructions, + +fprintf(1,'\n'); +fprintf(1,'*----------------------------------------------------------------------------------------------------*\n'); +fprintf(1,'| Main Calibration toolbox (2D and 3D rigs) |\n'); +fprintf(1,'| (c) Jean-Yves Bouguet - September 9th, 1999 |\n'); +fprintf(1,'*----------------------------------------------------------------------------------------------------*\n\n\n'); + +fprintf(1,'CLICK ON:\n\n'); + +fprintf(1,'2D: To perform camera calibration from multiple views of a 2D planar grid. \n'); +fprintf(1,' Set default size of grid (in dX_default and dY_default) in click_calib.m.\n'); +fprintf(1,'3D: To perform camera calibration from multiple views of a 3D grid corner. \n'); +fprintf(1,' Set default size of grids (in dX_default and dY_default) in click_calib3D.m.\n'); +fprintf(1,'Exit: To close the calibration tool. \n'); + +end; + +instructions = 0; + +fig_number = 1; + +n_row = 1; +n_col = 3; + +string_list = cell(n_row,n_col); +callback_list = cell(n_row,n_col); + +x_size = 40; +y_size = 20; + +title_figure = 'Calibration tool'; + +string_list{1,1} = '2D rig'; +string_list{1,2} = '3D rig'; +string_list{1,3} = 'Exit'; + +callback_list{1,1} = 'calib_gui;'; +callback_list{1,2} = 'calib3D_gui;'; +callback_list{1,3} = ['disp(''Bye. To run again, type calib.''); close(' num2str(fig_number) ');']; + + +figure(fig_number); clf; +pos = get(fig_number,'Position'); + +fig_size_x = x_size*n_col+(n_col+1)*2; +fig_size_y = y_size*n_row+(n_row+1)*2; + +set(fig_number,'Units','points', ... + 'BackingStore','off', ... + 'Color',[0.8 0.8 0.8], ... + 'MenuBar','none', ... + 'Resize','off', ... + 'Name',title_figure, ... +'Position',[pos(1) pos(2) fig_size_x fig_size_y], ... +'NumberTitle','off'); + + +for i=n_row:-1:1, + for j = n_col:-1:1, + if (~isempty(callback_list{i,j}))&(~isempty(string_list{i,j})), + uicontrol('Parent',fig_number, ... + 'Units','points', ... + 'Callback',callback_list{i,j}, ... + 'ListboxTop',0, ... + 'Position',[(2+(j-1)*(x_size+2)) (fig_size_y - i*(2+y_size)) x_size y_size], ... + 'String',string_list{i,j}, ... + 'Tag','Pushbutton1'); + end; + end; +end; + -- cgit v1.2.2