% By Philip Torr 2002
% copyright Microsoft Corp.
%
% %designed for the good of the world by Philip Torr based on ideas contained in
% copyright Philip Torr and Microsoft Corp 2002
%
% @inproceedings{Torr93b,
% author = "Torr, P. H. S. and Murray, D. W.",
% title = "Outlier Detection and Motion Segmentation",
% booktitle = "Sensor Fusion VI",
% editor = "Schenker, P. S.",
% publisher = "SPIE volume 2059",
% note = "Boston",
% pages = {432-443},
% year = 1993 }
%
%
% @phdthesis{Torr:thesis,
% author="Torr, P. H. S.",
% title="Outlier Detection and Motion Segmentation",
% school=" Dept. of Engineering Science, University of Oxford",
% year=1995}
%
% @inproceedings{Beardsley96a,
% author="Beardsley, P. and Torr, P. H. S. and Zisserman, A.",
% title="{3D} Model Aquisition from Extended Image Sequences",
% booktitle=eccv4.2,
% editor = "Buxton, B. and Cipolla R.",
% publisher = "Springer--Verlag",
% pages={683--695},
% year=1996}
%
%
% @article{Torr97c,
% author="Torr, P. H. S. and Murray, D. W. ",
% title="The Development and Comparison of Robust Methods for Estimating the Fundamental Matrix",
% journal="IJCV",
% volume = 24,
% number = 3,
% pages = {271--300},
% year=1997
% }
%
%
%
%
% @article{Torr99c,
% author = "Torr, P. H. S. and Zisserman, A",
% title ="MLESAC: A New Robust Estimator with Application to Estimating Image Geometry ",
% journal = "CVIU",
% Volume = {78},
% number = 1,
% pages = {138-156},
% year = 2000}
%
% %MAPSAC is the Bayesian version of MLESAC, and it is easier to pronounce!
% it is described in:
%
% @article{Torr02d,
% author = "Torr, P. H. S.",
% title ="Bayesian Model Estimation and Selection for Epipolar Geometry and
% Generic Manifold Fitting",
% journal = "IJCV",
% Volume = {?},
% number = ?,
% pages = {?},
% url = "http://research.microsoft.com/~philtorr/",
% year = 2002}
%
function varargout = torr_tool(varargin)
% TORR_TOOL Application M-file for torr_tool.fig
% FIG = TORR_TOOL launch torr_tool GUI.
% TORR_TOOL('callback_name', ...) invoke the named callback.
% Last Modified by GUIDE v2.0 21-May-2002 17:58:20
if nargin == 0 % LAUNCH GUI
fig = openfig(mfilename,'reuse');
% Use system color scheme for figure:
set(fig,'Color',get(0,'defaultUicontrolBackgroundColor'));
% Generate a structure of handles to pass to callbacks, and store it.
handles = guihandles(fig);
%phils atuff added, initialization
%corner parameters
handles.n_corners = 2000; %max no of corners permitted/requested
handles.n_corners1 = 0; %the actual number detected
handles.n_corners2 = 0;
handles.corner_sigma = 1.0;
handles.corner_width = 3;
%matchin parameters
handles.max_disparity = 50;
handles.match_half_size = 3;
%F parameters:
handles.no_samp = 500; % no of samples in the mapsac algorithm
handles.f_threshold = 6.0; % f_threshold in the mapsac algorithm
%calibration matrix
handles.focal_length = 3; %first guess
handles.aspect_ratio = 1;
handles.ppx = 0;
handles.ppy = 0;
%work out calibration matrix
C = [handles.aspect_ratio 0 handles.ppx; 0 1 handles.ppy; 0 0 1/handles.focal_length];
handles.C = C;
%informational variables
handles.n_matches = 0; %how many matches have we detected.
%general parameters
%debugt mode
handles.debug = 1;
handles.m3 = 256; %third homogeous pixel coordinate, chosen as 256 to help conditioning, see my thesis
handles.pathname = ['C:\matlabR12\bin\'];
if ~handles.debug
helpdlg('Phil asks: "how ya diddling", first load some images')
end
set(handles.save_image1_button, 'Enable', 'off');
set(handles.save_image2_button, 'Enable', 'off');
set(handles.Save_Images_menu, 'Enable', 'off');
%for corners
set(handles.detect_corner_button, 'Enable', 'off');
set(handles.save_corner_button, 'Enable', 'off');
set(handles.load_corner_button, 'Enable', 'on');
set(handles.corn_param_button, 'Enable', 'off');
%for correlation matches
set(handles.match_button, 'Enable', 'off');
set(handles.match_param_button, 'Enable', 'on');
set(handles.manual_match_button, 'Enable', 'on');
set(handles.save_match_button, 'Enable', 'off');
set(handles.load_match_button, 'Enable', 'off');
%for F and correlation matches
set(handles.mapsac_button, 'Enable', 'off');
set(handles.mapsac_parameters_button, 'Enable', 'on');
set(handles.save_F_button, 'Enable', 'off');
set(handles.display_epipolar_button, 'Enable', 'off');
set(handles.display_epipolar_button2, 'Enable', 'off');
set(handles.ImproveF_button, 'Enable', 'off');
%for SFM
set(handles.sfm_button, 'Enable', 'off');
guidata(fig, handles);
if nargout > 0
varargout{1} = fig;
end
elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK
try
[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
catch
disp(lasterr);
end
end
%| ABOUT CALLBACKS:
%| GUIDE automatically appends subfunction prototypes to this file, and
%| sets objects' callback properties to call them through the FEVAL
%| switchyard above. This comment describes that mechanism.
%|
%| Each callback subfunction declaration has the following form:
%| <SUBFUNCTION_NAME>(H, EVENTDATA, HANDLES, VARARGIN)
%|
%| The subfunction name is composed using the object's Tag and the
%| callback type separated by '_', e.g. 'slider2_Callback',
%| 'figure1_CloseRequestFcn', 'axis1_ButtondownFcn'.
%|
%| H is the callback object's handle (obtained using GCBO).
%|
%| EVENTDATA is empty, but reserved for future use.
%|
%| HANDLES is a structure containing handles of components in GUI using
%| tags as fieldnames, e.g. handles.figure1, handles.slider2. This
%| structure is created at GUI startup using GUIHANDLES and stored in
%| the figure's application data using GUIDATA. A copy of the structure
%| is passed to each callback. You can store additional information in
%| this structure at GUI startup, and you can change the structure
%| during callbacks. Call guidata(h, handles) after changing your
%| copy to replace the stored original so that subsequent callbacks see
%| the updates. Type "help guihandles" and "help guidata" for more
%| information.
%|
%| VARARGIN contains any extra arguments you have passed to the
%| callback. Specify the extra arguments by editing the callback
%| property in the inspector. By default, GUIDE sets the property to:
%| <MFILENAME>('<SUBFUNCTION_NAME>', gcbo, [], guidata(gcbo))
%| Add any extra arguments after the last argument, before the final
%| closing parenthesis.
% --------------------------------------------------------------------
%%get rid f current stuff and do it again!
function varargout = start_again_button_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.start_again_button.
clear_button_Callback(h, eventdata, handles, varargin)
initialize(handles)
% --------------------------------------------------------------------
function varargout = frame1_Callback(h, eventdata, handles, varargin)
% Stub for Callback of the uicontrol handles.frame1.
disp('frame1 Callback not implemented yet. O great one')
%---------------------------------------------------------------------\\\
function menu_OpenImage_Callback(h,eventdata,handles,varargin)
disp('loading some images your highness')
load_image_button_Callback(h, eventdata, handles, varargin)
%----------------------------------------
- 1
- 2
前往页