Changeset 1110 for trunk


Ignore:
Timestamp:
Jan 20, 2022, 8:30:32 PM (3 years ago)
Author:
sommeria
Message:

calibration with plane angl corrected

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/phys_XYZ.m

    r1109 r1110  
    7777    R=(Calib.R)';
    7878    c=Z0virt;
     79    cvirt=Z0virt;
    7980    if testangle
    8081        % equation of the illumination plane: z=ax+by+c
     
    9091        cvirt=Z0virt-avirt*Calib.SliceCoord(Zindex,1)-bvirt*Calib.SliceCoord(Zindex,2);% Z0 = (virtual) z coordinate on the rotation axis (assumed horizontal)
    9192                               % c=z coordinate at (x,y)=(0,0)
     93        c=Z0virt-a*Calib.SliceCoord(Zindex,1)-b*Calib.SliceCoord(Zindex,2);
    9294        R(1)=R(1)+avirt*R(3);
    9395        R(2)=R(2)+bvirt*R(3);
  • trunk/src/proj_field.m

    r1107 r1110  
    10861086        end
    10871087    else % the z coordinate is set only by the field plane (by calibration)
    1088         ProjData.ProjObjectCoord(3)=FieldData.PlaneCoord(3);
     1088        ProjData.ProjObjectCoord=FieldData.PlaneCoord;
    10891089    end
    10901090    if isfield(FieldData,'PlaneAngle')
  • trunk/src/series/extract_rdvision.m

    r1107 r1110  
    209209                if check_xml
    210210                    [success,errormsg] = copyfile(filexml,[fullfile(RootPath,logdir,Param.InputTable{iview,3}) '.xml']); %copy the original xml file in the upper folder
     211                else
     212                    errormsg=[filexml ' missing'];
     213                    return
    211214                end
    212215            end
  • trunk/src/series/time_series.m

    r1107 r1110  
    508508   
    509509    % record the time:
     510    if isempty(errormsg)
    510511    if isempty(time)% time not set by xml filer(s)
    511512        if isfield(Data{1},'Time')
     
    516517    else % time from ImaDoc prevails  TODO: correct
    517518        DataOut.Time(index,1)=time(index);%
     519    end
    518520    end
    519521    index
  • trunk/src/toolbox_calib/go_calib_optim_iter.m

    r926 r1110  
    3030%For now, if using a 3D calibration rig, quick_init is set to 1 for an easy initialization of the focal length
    3131
    32 if ~exist('desactivated_images'),
     32if ~exist('desactivated_images','var')
    3333    desactivated_images = [];
    34 end;
    35 
    36 
    37 
    38 if ~exist('est_aspect_ratio'),
     34end
     35
     36if ~exist('est_aspect_ratio','var')
    3937    est_aspect_ratio = 1;
    40 end;
    41 
    42 if ~exist('est_fc');
     38end
     39
     40if ~exist('est_fc','var')
    4341    est_fc = [1;1]; % Set to zero if you do not want to estimate the focal length (it may be useful! believe it or not!)
    44 end;
    45 
    46 if ~exist('recompute_extrinsic'),
     42end
     43
     44if ~exist('recompute_extrinsic','var')
    4745    recompute_extrinsic = 1; % Set this variable to 0 in case you do not want to recompute the extrinsic parameters
    4846    % at each iterstion.
    49 end;
    50 
    51 if ~exist('MaxIter'),
     47end
     48
     49if ~exist('MaxIter','var')
    5250    MaxIter = 30; % Maximum number of iterations in the gradient descent
    5351end;
    5452
    55 if ~exist('check_cond'),
     53if ~exist('check_cond','var'),
    5654    check_cond = 1; % Set this variable to 0 in case you don't want to extract view dynamically
    5755end;
    5856
    59 if ~exist('center_optim'),
     57if ~exist('center_optim','var'),
    6058    center_optim = 1; %%% Set this variable to 0 if your do not want to estimate the principal point
    6159end;
    6260
    63 if exist('est_dist'),
     61if exist('est_dist','var'),
    6462    if length(est_dist) == 4,
    6563        est_dist = [est_dist ; 0];
     
    6765end;
    6866
    69 if ~exist('est_dist'),
     67if ~exist('est_dist','var'),
    7068    est_dist = [1;1;1;1;0];
    7169end;
    7270
    73 if ~exist('est_alpha'),
     71if ~exist('est_alpha','var'),
    7472    est_alpha = 0; % by default, do not estimate skew
    7573end;
     
    8785fprintf(1,'\n');
    8886
    89 if ~exist('nx')&~exist('ny'),
     87if ~exist('nx','var')&~exist('ny','var'),
    9088    fprintf(1,'WARNING: No image size (nx,ny) available. Setting nx=640 and ny=480. If these are not the right values, change values manually.\n');
    9189    nx = 640;
     
    116114end;
    117115
    118 if ~exist('dont_ask'),
     116if ~exist('dont_ask','var'),
    119117    dont_ask = 0;
    120118end;
     
    161159if ~center_optim, % In the case where the principal point is not estimated, keep it at the center of the image
    162160    fprintf(1,'Principal point not optimized (center_optim=0). ');
    163     if ~exist('cc'),
     161    if ~exist('cc','var'),
    164162        fprintf(1,'It is kept at the center of the image.\n');
    165163        cc = [(nx-1)/2;(ny-1)/2];
     
    228226% Initialization of the intrinsic parameters (if necessary)
    229227
    230 if ~exist('cc'),
     228if ~exist('cc','var')
    231229    fprintf(1,'Initialization of the principal point at the center of the image.\n');
    232230    cc = [(nx-1)/2;(ny-1)/2];
    233231    alpha_smooth = 0.1; % slow convergence
    234 end;
    235 
    236 
    237 if exist('kc'),
    238     if length(kc) == 4;
     232end
     233
     234
     235if exist('kc','var')
     236    if length(kc) == 4
    239237        fprintf(1,'Adding a new distortion coefficient to kc -> radial distortion model up to the 6th degree');
    240238        kc = [kc;0];
    241     end;
    242 end;
    243 
    244 if ~exist('alpha_c'),
     239    end
     240end
     241
     242if ~exist('alpha_c','var')
    245243    fprintf(1,'Initialization of the image skew to zero.\n');
    246244    alpha_c = 0;
    247245    alpha_smooth = 0.1; % slow convergence
    248 end;
    249 
    250 if ~exist('fc') && quick_init,
     246end
     247
     248if ~exist('fc','var') && quick_init
    251249    FOV_angle = 35; % Initial camera field of view in degrees
    252250    fprintf(1,['Initialization of the focal length to a FOV of ' num2str(FOV_angle) ' degrees.\n']);
     
    254252    est_fc = [1;1];
    255253    alpha_smooth = 0.1; % slow
    256 end;
    257 
    258 
    259 if ~exist('fc'),
     254end
     255
     256
     257if ~exist('fc','var')
    260258    % Initialization of the intrinsic parameters:
    261259    fprintf(1,'Initialization of the intrinsic parameters using the vanishing points of planar patterns.\n')
     
    263261    alpha_smooth = 0.1; % slow convergence
    264262    est_fc = [1;1];
    265 end;
     263end
    266264
    267265
  • trunk/src/uvmat.m

    r1108 r1110  
    34193419    if ~isempty(errormsg)
    34203420        msgbox_uvmat('ERROR',errormsg);
     3421        return
    34213422    end
    34223423    pause(1.02-get(handles.speed,'Value'));% wait for next image
     
    34943495end
    34953496UvData=get(handles.uvmat,'UserData');
    3496 if ishandle(handles.UVMAT_title) %remove title panel on uvmat
     3497if ishandle(handles.UVMAT_title) %remove title panel on uvmat (which appears at the first openning of the GUI)
    34973498    delete(handles.UVMAT_title)
    34983499end
     
    39983999     set(handles.Objects,'Visible','on')
    39994000    %if no projection object exists, create a default one
    4000     if isempty(UvData.ProjObject{1})
     4001    if isempty(UvData.ProjObject{1})% if no projection object is specified
    40014002        set(handles.ListObject,'Value',1)
    40024003        set(handles.ListObject,'String',{'plane'})
     
    40154016                UvData.ProjObject{1}.CoordUnit=UvData.Field.CoordUnit;
    40164017            end
    4017         elseif isfield(UvData,'Z')
     4018        %elseif isfield(UvData,'Z')
     4019        else
    40184020            %multilevel case (single menuplane in a 3D space)
    40194021            if isfield(UvData,'CoordType')&& isequal(UvData.CoordType,'phys') && isfield(UvData,'XmlData')
Note: See TracChangeset for help on using the changeset viewer.