gusucode.com > 基于matlab软件,实现双目视觉原理的摄像机标定,能根据各视场图像求内、外部参数 > 基于matlab软件,实现双目视觉原理的摄像机标定,能根据各视场图像求内、外部参数/TOOLBOX_calib/calib_gui_normal.m

    function calib_gui_normal,


cell_list = {};


%-------- Begin editable region -------------%
%-------- Begin editable region -------------%


fig_number = 1;

title_figure = 'Camera Calibration Toolbox - Standard Version';

cell_list{1,1} = {'Image names','data_calib;'};
cell_list{1,2} = {'Read images','ima_read_calib;'};
cell_list{1,3} = {'Extract grid corners','click_calib;'};
cell_list{1,4} = {'Calibration','go_calib_optim;'};
cell_list{2,1} = {'Show Extrinsic','ext_calib;'};
cell_list{2,2} = {'Reproject on images','reproject_calib;'};
cell_list{2,3} = {'Analyse error','analyse_error;'};
cell_list{2,4} = {'Recomp. corners','recomp_corner_calib;'};
cell_list{3,1} = {'Add/Suppress images','add_suppress;'};
cell_list{3,2} = {'Save','saving_calib;'};
cell_list{3,3} = {'Load','loading_calib;'};
cell_list{3,4} = {'Exit',['disp(''Bye. To run again, type calib_gui.''); close(' num2str(fig_number) ');']}; %{'Exit','calib_gui;'};
cell_list{4,1} = {'Comp. Extrinsic','extrinsic_computation;'};
cell_list{4,2} = {'Undistort image','undistort_image;'};
cell_list{4,3} = {'Export calib data','export_calib_data;'};
cell_list{4,4} = {'Show calib results','show_calib_results;'};
%cell_list{5,1} = {'Smooth images','smooth_images;'};


show_window(cell_list,fig_number,title_figure,130,18,0,'clean',12);


%-------- End editable region -------------%
%-------- End editable region -------------%






%------- DO NOT EDIT ANYTHING BELOW THIS LINE -----------%

function show_window(cell_list,fig_number,title_figure,x_size,y_size,gap_x,font_name,font_size)


if ~exist('cell_list'),
    error('No description of the functions');
end;

if ~exist('fig_number'),
    fig_number = 1;
end;
if ~exist('title_figure'),
    title_figure = '';
end;
if ~exist('x_size'),
    x_size = 85;
end;
if ~exist('y_size'),
    y_size = 14;
end;
if ~exist('gap_x'),
    gap_x = 0;
end;
if ~exist('font_name'),
    font_name = 'clean';
end;
if ~exist('font_size'),
    font_size = 8;
end;

figure(fig_number); clf;
pos = get(fig_number,'Position');

[n_row,n_col] = size(cell_list);

fig_size_x = x_size*n_col+(n_col+1)*gap_x;
fig_size_y = y_size*n_row+(n_row+1)*gap_x;

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'); %,'WindowButtonMotionFcn',['figure(' num2str(fig_number) ');']);

h_mat = zeros(n_row,n_col);

posx = zeros(n_row,n_col);
posy = zeros(n_row,n_col);

for i=n_row:-1:1,
   for j = n_col:-1:1,
      posx(i,j) = gap_x+(j-1)*(x_size+gap_x);
      posy(i,j) = fig_size_y - i*(gap_x+y_size);
   end;
end;

for i=n_row:-1:1,
    for j = n_col:-1:1,
        if ~isempty(cell_list{i,j}),
            if ~isempty(cell_list{i,j}{1}) & ~isempty(cell_list{i,j}{2}),
                h_mat(i,j) = uicontrol('Parent',fig_number, ...
                    'Units','points', ...
                    'Callback',cell_list{i,j}{2}, ...
                    'ListboxTop',0, ...
                    'Position',[posx(i,j)  posy(i,j)  x_size   y_size], ...
                    'String',cell_list{i,j}{1}, ...
                    'fontsize',font_size,...
                    'fontname',font_name,...
                    'Tag','Pushbutton1');
            end;
        end;
    end;
end;

%------ END PROTECTED REGION ----------------%