⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fm_gui.m

📁 此为基于图像配准的傅立叶变换源代码
💻 M
📖 第 1 页 / 共 2 页
字号:
close all
global FM_PATH
colo=[0.9 0.9 0.9];

FM_PATH = [pwd filesep]  ;
disp('Change directory to the location of fm_gui.m...')
disp('...or change the value of FM_PATH in fm_gui.m.')

% ------------- the MAIN figure window ----------------------
h0 = figure('Units','normalized', ...
	'Color',colo, ...
	'CreateFcn','fm_guifun create', ...
	'Name','Fourier-Mellin Transform GUI', ...
	'NumberTitle','off', ...
	'PaperOrientation','landscape', ...
	'PaperType','a4letter', ...
  	'Position',[0.1 0.1 0.8 0.8], ...
	'Tag','Fig1');

% --------------- QUIT button -------------------------------
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
   'ListboxTop',0, ...
   'ForegroundColor',[1 1 1], ...
   'BackgroundColor',[0 0 1], ...
   'TooltipString','Quit Fourier-Mellin transform', ...
   'Position',[0.88 0.02 0.09 0.09],...
   'Style','push', ...
   'String','Quit', ...
	'Tag','Exit','Callback','close(gcf)');

% --------------- HELP button ------------------------------
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'Callback','fm_guifun help', ...
	'ListboxTop',0, ...
	'Position',[0.88 0.12 0.09 0.09], ...
    'String','Help', ...
    'TooltipString','Invoke help window ', ...
   'Tag','Help');

% ------------------- axes for image 1 ------------------------------------
h1 = axes('Parent',h0, ...
	'Box','on', ...
	'CameraUpVector',[0 1 0], ...
	'CameraUpVectorMode','manual', ...
	'Color',[1 1 1], ...
   'FontSize',8, ...
	'Position',[0.02726146220570011 0.5022156573116691 0.3779429987608426 0.4387001477104873], ...
   'Tag','Axes1', ...
   'NextPlot','add', ...
  	'XColor',[0 0 0], ...
	'XTickMode','manual', ...
	'YColor',[0 0 0], ...
	'YTickMode','manual', ...
   'ZColor',[0 0 0]);

h2 = text('Parent',h1, ...
	'Color',[0 0 0], ...
	'HandleVisibility','off', ...
	'HorizontalAlignment','center', ...
	'Position',[0.4966216216216217 -0.03041825095057038 9.160254037844386], ...
	'Tag','Axes1Text4', ...
	'VerticalAlignment','cap');
set(get(h2,'Parent'),'XLabel',h2);

h2 = text('Parent',h1, ...
	'Color',[0 0 0], ...
	'HandleVisibility','off', ...
	'HorizontalAlignment','center', ...
	'Position',[-0.02364864864864866 0.4942965779467681 9.160254037844386], ...
	'Rotation',90, ...
	'Tag','Axes1Text3', ...
	'VerticalAlignment','baseline');
set(get(h2,'Parent'),'YLabel',h2);

h2 = text('Parent',h1, ...
	'Color',[0 0 0], ...
	'HandleVisibility','off', ...
	'HorizontalAlignment','right', ...
	'Position',[-0.07432432432432433 1.129277566539924 9.160254037844386], ...
	'Tag','Axes1Text2', ...
	'Visible','off');
set(get(h2,'Parent'),'ZLabel',h2);

h2 = text('Parent',h1, ...
	'Color',[0 0 0], ...
	'HandleVisibility','off', ...
	'HorizontalAlignment','center', ...
	'Position',[0.4966216216216217 1.022813688212928 9.160254037844386], ...
	'Tag','Axes1Text1', ...
	'VerticalAlignment','bottom');
set(get(h2,'Parent'),'Title',h2);

% ------------------- axes for image 2 ------------------------------------

h1 = axes('Parent',h0, ...
	'Box','on', ...
	'CameraUpVector',[0 1 0], ...
	'CameraUpVectorMode','manual', ...
	'Color',[1 1 1], ...
   'FontSize',8, ...
	'Position',[0.02853598014888337 0.01329394387001477 0.3784119106699752 0.4401772525849335], ...
   'Tag','Axes2', ...
   'NextPlot','add', ...
	'XColor',[0 0 0], ...
	'XTickMode','manual', ...
	'YColor',[0 0 0], ...
	'YTickMode','manual', ...
	'ZColor',[0 0 0]);

% xlabel
h2 = text('Parent',h1, ...
	'ButtonDownFcn','ctlpanel SelectMoveResize', ...
	'Color',[0 0 0], ...
	'HandleVisibility','off', ...
	'HorizontalAlignment','center', ...
	'Interruptible','off', ...
	'Position',[0.4966216216216217 -0.03041825095057016 9.160254037844386], ...
	'Tag','Axes2Text4', ...
	'VerticalAlignment','cap');
set(get(h2,'Parent'),'XLabel',h2);

% ylabel
h2 = text('Parent',h1, ...
	'ButtonDownFcn','ctlpanel SelectMoveResize', ...
	'Color',[0 0 0], ...
	'HandleVisibility','off', ...
	'HorizontalAlignment','center', ...
	'Interruptible','off', ...
	'Position',[-0.02364864864864864 0.4942965779467681 9.160254037844386], ...
	'Rotation',90, ...
	'Tag','Axes2Text3', ...
	'VerticalAlignment','baseline');
set(get(h2,'Parent'),'YLabel',h2);

% zlabel
h2 = text('Parent',h1, ...
	'ButtonDownFcn','ctlpanel SelectMoveResize', ...
	'Color',[0 0 0], ...
	'HandleVisibility','off', ...
	'HorizontalAlignment','right', ...
	'Interruptible','off', ...
	'Position',[-0.0777027027027027 2.247148288973384 9.160254037844386], ...
	'Tag','Axes2Text2', ...
	'Visible','off');
set(get(h2,'Parent'),'ZLabel',h2);

% title
h2 = text('Parent',h1, ...
	'ButtonDownFcn','ctlpanel SelectMoveResize', ...
	'Color',[0 0 0], ...
	'HandleVisibility','off', ...
	'HorizontalAlignment','center', ...
	'Interruptible','off', ...
	'Position',[0.4966216216216217 1.022813688212928 9.160254037844386], ...
	'Tag','Axes2Text1', ...
	'VerticalAlignment','bottom');
set(get(h2,'Parent'),'Title',h2);

%*****************************************

% display image names
% - IMAGE 1 ------------------------------------------------------------------
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',colo, ...
	'FontSize',12, ...
	'ListboxTop',0, ...
	'Position',[0.0060    0.9435    0.2245    0.0266], ...
	'String','Input 1', ...
	'Style','text', ...
	'Tag','Ref_im');



h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',colo, ...
	'FontSize',12, ...
	'ListboxTop',0, ...
	'Position',[0.1860    0.9435    0.2245    0.0266], ...
	'String','', ...
	'Style','text', ...
	'Tag','Ref_im_c');

h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',colo, ...
	'FontSize',12, ...
	'ListboxTop',0, ...
	'Position',[0.0060    0.4535    0.2246    0.0281], ...
	'String','Input 2', ...
	'Style','text', ...
	'Tag','Sens_im');

h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',colo, ...
	'FontSize',12, ...
	'ListboxTop',0, ...
	'Position',[0.1860    0.4535    0.2246    0.0281], ...
	'String','', ...
	'Style','text', ...
	'Tag','Sens_im_c');

h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',colo, ...
	'FontSize',12, ...
	'ListboxTop',0, ...
	'Position',[0.83    0.68    0.15    0.0281], ...
	'String','Registered Image', ...
	'Style','text', ...
	'Tag','Reg_im');

h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',colo, ...
	'FontSize',12, ...
	'ListboxTop',0, ...
	'Position',[0.67    0.68    0.15    0.0281], ...
	'String','', ...
	'Style','text', ...
	'Tag','Reg_im_c');

%*****************************************
% button for loading image 1
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'Callback','fm_guifun loadA; fm_guifun RotateScaleCropInput2; fm_guifun input1Select; fm_guifun input2Select;', ...
	'ListboxTop',0, ...
	'Position',[0.419 0.83 0.1 0.1], ...
   'String','Load Input 1', ...
   'TooltipString','Load image 1', ...
   'Tag','Pushbutton2');

% pop-up menu for image 1 selection ------------------------------
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',colo, ...
	'Callback','fm_guifun input1Select', ...
	'ListboxTop',0, ...
	'Position',[0.42 0.7735 0.1 0.04], ...
	'String','Input|Windowed Input|Magnitude Spectrum|Phase Spectrum|Log-Polar|Windowed Log-polar|Invariant Features', ...
    'Style','popupmenu', ...
    'TooltipString','Input 1 analysis selection', ...
	'Tag','input1analysis', ...
	'Value',1);

% button for loading image 2
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'Callback','fm_guifun loadB; fm_guifun RotateScaleCropInput2; fm_guifun input1Select; fm_guifun input2Select;', ...
	'ListboxTop',0, ...
	'Position',[0.419 0.34 0.1 0.1], ...
   'String','Load Input 2', ...
   'TooltipString','Load image 2', ...
   'Tag','Pushbutton2');

% pop-up menu for image 2 selection ------------------------------------
h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',colo, ...
	'Callback','fm_guifun input2Select', ...
	'ListboxTop',0, ...
	'Position',[0.42 0.2835 0.1 0.04], ...
	'String','Input|Windowed Input|Magnitude Spectrum|Phase Spectrum|Log-Polar|Windowed Log-polar|Invariant Features', ...
    'Style','popupmenu', ...
    'TooltipString','Input 2 analysis selection', ...
	'Tag','input2analysis', ...
	'Value',1);

% ----------- Rotate input 2 edit box ----------------------------------
  h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',colo, ...
	'HorizontalAlignment','left', ...
	'Position',[0.42 0.23 0.05 0.04], ...
   'String','Rotate image 2', ...
   'TooltipString','Apply a rotation to image 2', ...
	'Style','text', ...
	'Tag','RotText');

h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[1 1 1], ...
    'Callback','fm_guifun RotateScaleCropInput2; fm_guifun input2Select; fm_guifun input1Select;',...
    'Position',[0.47 0.24 0.05 0.03], ...
	'String','0', ...
	'Style','edit', ...
	'Tag','RotInput2');

% ----------- Scale input 2 edit box ----------------------------------
  h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',colo, ...
	'HorizontalAlignment','left', ...
	'Position',[0.42 0.18 0.05 0.04], ...
   'String','Scale image 2', ...
   'TooltipString','Apply a scale change to image 2', ...
	'Style','text', ...
	'Tag','SclText');

h1 = uicontrol('Parent',h0, ...
	'Units','normalized', ...
	'BackgroundColor',[1 1 1], ...
    'Callback','fm_guifun RotateScaleCropInput2; fm_guifun input2Select; fm_guifun input1Select;',...
    'Position',[0.47 0.19 0.05 0.03], ...
	'String','0', ...
	'Style','edit', ...
	'Tag','SclInput2');

% ----------- crop input 2 edit box ----------------------------------
%  h1 = uicontrol('Parent',h0, ...
%	'Units','normalized', ...
%	'BackgroundColor',colo, ...
%	'HorizontalAlignment','left', ...
%	'Position',[0.42 0.13 0.05 0.04], ...
%   'String','Resize image 2', ...
%   'TooltipString','Size', ...
%	'Style','text', ...
%	'Tag','SclText');

%h1 = uicontrol('Parent',h0, ...
%	'Units','normalized', ...
%	'BackgroundColor',[1 1 1], ...
%    'Callback','fm_guifun RotateScaleCropInput2; fm_guifun input2Select; fm_guifun input1Select;',...
%    'Position',[0.47 0.14 0.05 0.03], ...
%	'String','100', ...
%	'Style','edit', ...
%	'Tag','CropInput2');

% ----------------- AUTOCROP check box ------------------------
h1 = uicontrol('Parent',h0, ...
   'Units','normalized', ...
  	'BackgroundColor',colo, ...
	'Callback','fm_guifun autocrop; fm_guifun RotateScaleCropInput2; fm_guifun input2Select; fm_guifun input1Select;', ...
	'ListboxTop',0, ...
	'Position',[0.42 0.13 0.07 0.05], ...
   'String','Autocrop', ...
   'TooltipString','Enable auto-cropping of inputs', ...
   'Style','checkbox',...
	'Tag','cb_autocrop');


% ----------------------- REGISTER button ------------------------------
% button for registering images

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -