Ignore:
Timestamp:
Dec 19, 2010, 10:11:04 PM (14 years ago)
Author:
sommeria
Message:

many bug repairs and corrections for mouse action
create_grid: option for black marjkers for grid detection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r149 r156  
    7575%------------------------------------------------------------------------
    7676% Choose default command line output for geometry_calib
     77
    7778handles.output = hObject;
    7879
     
    8283
    8384%set the position of the interface
    84 if exist('pos','var')&& length(pos)>2
    85     pos_gui=get(hObject,'Position');
    86     pos_gui(1)=pos(1);
    87     pos_gui(2)=pos(2);
    88     set(hObject,'Position',pos_gui);
     85if exist('pos','var')&& length(pos)>=4
     86%     %pos_gui=get(hObject,'Position');
     87%     pos_gui(1)=pos(1);
     88%     pos_gui(2)=pos(2);
     89    set(hObject,'Position',pos);
    8990end
    9091
    9192%set menu of calibration options
    92 %set(handles.calib_type,'String',{'rescale';'linear';'perspective';'normal';'tsai';'bouguet';'extrinsic'})
    9393set(handles.calib_type,'String',{'rescale';'linear';'3D_linear';'3D_quadr';'3D_extrinsic'})
    9494inputxml='';
     
    9999        inputfile=[fullfile(Pathsub,RootFile) '.xml'];%xml file corresponding to the input file
    100100    end
    101 end
    102 set(handles.ListCoord,'String',{'......'})
    103 if exist(inputfile,'file')
    104     Heading=loadfile(handles,inputfile);% load the point coordiantes existing in the xml file
    105 end
    106 if isfield(Heading,'Campaign')&& ischar(Heading.Campaign)
    107     struct.Campaign=Heading.Campaign;
    108 end
    109 set(hObject,'UserData',struct)
     101    set(handles.ListCoord,'String',{'......'})
     102    if exist(inputfile,'file')
     103        Heading=loadfile(handles,inputfile);% load the point coordiantes existing in the xml file
     104        if isfield(Heading,'Campaign')&& ischar(Heading.Campaign)
     105            struct.Campaign=Heading.Campaign;
     106        end
     107    end   
     108    set(hObject,'UserData',struct)
     109end
     110
    110111set(handles.ListCoord,'KeyPressFcn',{@key_press_fcn,handles})%set keyboard action function
    111112
     
    126127if ~isempty(huvmat)
    127128    handles=guidata(huvmat);
    128     set(handles.MenuMask,'enable','on')
    129     set(handles.MenuGrid,'enable','on')
    130     set(handles.MenuObject,'enable','on')
    131     set(handles.MenuEdit,'enable','on')
    132     set(handles.edit,'enable','on')
     129%     set(handles.MenuMask,'enable','on')
     130%     set(handles.MenuGrid,'enable','on')
     131%     set(handles.MenuObject,'enable','on')
     132%     set(handles.MenuEdit,'enable','on')
     133%     set(handles.edit,'enable','on')
    133134    hobject=findobj(handles.axes3,'tag','calib_points');
    134135    if ~isempty(hobject)
     
    11031104    grid_input=CalibData.grid;%retrieve the previously used grid
    11041105end
    1105 [T,CalibData.grid]=create_grid(grid_input,'detect_grid');%display the GUI create_grid, read the set of phys coordinates T
     1106[T,CalibData.grid,white_test]=create_grid(grid_input,'detect_grid');%display the GUI create_grid, read the set of phys coordinates T
    11061107
    11071108set(handles.geometry_calib,'UserData',CalibData)%store the phys grid parameters for later use
     
    12001201% [Amod,Rangx,Rangy]=phys_Ima(A-min(min(A)),GeometryCalib,0);
    12011202
    1202 
    1203 Amod=double(Amod);
     1203if white_test
     1204    Amod=double(Amod);%will look for image maxima
     1205else
     1206    Amod=-double(Amod);%will look for image minima
     1207end
    12041208% figure(12) %display corrected image
    12051209% Amax=max(max(Amod));
Note: See TracChangeset for help on using the changeset viewer.