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/calib_bouguetj/calib.m | |
| 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/calib_bouguetj/calib.m')
| -rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/calib_bouguetj/calib.m | 74 |
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 @@ | |||
| 1 | if ~exist('instructions'), instructions = 1; end; | ||
| 2 | |||
| 3 | if instructions, | ||
| 4 | |||
| 5 | fprintf(1,'\n'); | ||
| 6 | fprintf(1,'*----------------------------------------------------------------------------------------------------*\n'); | ||
| 7 | fprintf(1,'| Main Calibration toolbox (2D and 3D rigs) |\n'); | ||
| 8 | fprintf(1,'| (c) Jean-Yves Bouguet - September 9th, 1999 |\n'); | ||
| 9 | fprintf(1,'*----------------------------------------------------------------------------------------------------*\n\n\n'); | ||
| 10 | |||
| 11 | fprintf(1,'CLICK ON:\n\n'); | ||
| 12 | |||
| 13 | fprintf(1,'2D: To perform camera calibration from multiple views of a 2D planar grid. \n'); | ||
| 14 | fprintf(1,' Set default size of grid (in dX_default and dY_default) in click_calib.m.\n'); | ||
| 15 | fprintf(1,'3D: To perform camera calibration from multiple views of a 3D grid corner. \n'); | ||
| 16 | fprintf(1,' Set default size of grids (in dX_default and dY_default) in click_calib3D.m.\n'); | ||
| 17 | fprintf(1,'Exit: To close the calibration tool. \n'); | ||
| 18 | |||
| 19 | end; | ||
| 20 | |||
| 21 | instructions = 0; | ||
| 22 | |||
| 23 | fig_number = 1; | ||
| 24 | |||
| 25 | n_row = 1; | ||
| 26 | n_col = 3; | ||
| 27 | |||
| 28 | string_list = cell(n_row,n_col); | ||
| 29 | callback_list = cell(n_row,n_col); | ||
| 30 | |||
| 31 | x_size = 40; | ||
| 32 | y_size = 20; | ||
| 33 | |||
| 34 | title_figure = 'Calibration tool'; | ||
| 35 | |||
| 36 | string_list{1,1} = '2D rig'; | ||
| 37 | string_list{1,2} = '3D rig'; | ||
| 38 | string_list{1,3} = 'Exit'; | ||
| 39 | |||
| 40 | callback_list{1,1} = 'calib_gui;'; | ||
| 41 | callback_list{1,2} = 'calib3D_gui;'; | ||
| 42 | callback_list{1,3} = ['disp(''Bye. To run again, type calib.''); close(' num2str(fig_number) ');']; | ||
| 43 | |||
| 44 | |||
| 45 | figure(fig_number); clf; | ||
| 46 | pos = get(fig_number,'Position'); | ||
| 47 | |||
| 48 | fig_size_x = x_size*n_col+(n_col+1)*2; | ||
| 49 | fig_size_y = y_size*n_row+(n_row+1)*2; | ||
| 50 | |||
| 51 | set(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 | |||
| 61 | for 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; | ||
| 73 | end; | ||
| 74 | |||
