Ignore:
Timestamp:
Feb 18, 2016, 12:05:51 PM (8 years ago)
Author:
sommeria
Message:

geometry cqlib updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/toolbox_calib/go_calib_optim_iter.m

    r924 r926  
    1 %=======================================================================
    2 % Copyright 2008-2016, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
    3 %   http://www.legi.grenoble-inp.fr
    4 %   Joel.Sommeria - Joel.Sommeria (A) legi.cnrs.fr
    5 %
    6 %     This file is part of the toolbox UVMAT.
    7 %
    8 %     UVMAT is free software; you can redistribute it and/or modify
    9 %     it under the terms of the GNU General Public License as published
    10 %     by the Free Software Foundation; either version 2 of the license,
    11 %     or (at your option) any later version.
    12 %
    13 %     UVMAT is distributed in the hope that it will be useful,
    14 %     but WITHOUT ANY WARRANTY; without even the implied warranty of
    15 %     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 %     GNU General Public License (see LICENSE.txt) for more details.
    17 %=======================================================================
    18 
    191%go_calib_optim_iter
    202%
     
    11496check_active_images;
    11597
     98
    11699quick_init = 0; % Set to 1 for using a quick init (necessary when using 3D rigs)
    117100
     
    169152        if isequal(est_fc,[0;1]),
    170153            fprintf(1,'The second component of focal (fc(1)) is estimated, but not the first one (est_fc=[0;1])\n');
    171         else 
     154        else
    172155            fprintf(1,'The focal vector fc is not optimized (est_fc=[0;0])\n');
    173156        end;
     
    236219
    237220alpha_smooth = 0.1; % set alpha_smooth = 1; for steepest gradient descent
    238 % alpha_smooth = 0.01; % modified L. Gostiaux
    239221
    240222
    241223% Conditioning threshold for view rejection
    242 thresh_cond = 1e5;
     224thresh_cond = 1e6;
    243225
    244226
     
    260242end;
    261243
    262 
    263 
    264244if ~exist('alpha_c'),
    265245    fprintf(1,'Initialization of the image skew to zero.\n');
     
    268248end;
    269249
    270 if ~exist('fc')& quick_init,
     250if ~exist('fc') && quick_init,
    271251    FOV_angle = 35; % Initial camera field of view in degrees
    272252    fprintf(1,['Initialization of the focal length to a FOV of ' num2str(FOV_angle) ' degrees.\n']);
     
    340320
    341321
    342 while (change > 1e-2)&(iter < MaxIter),
     322while (change > 1e-9) && (iter < MaxIter),
    343323   
    344324    fprintf(1,'%d...',iter+1);
     
    602582solution_error = param_error;
    603583
    604 if ~est_aspect_ratio & isequal(est_fc,[1;1]),
     584if ~est_aspect_ratio && isequal(est_fc,[1;1]),
    605585    solution_error(2) = solution_error(1);
    606586end;
     
    615595
    616596fprintf(1,'\n\nCalibration results after optimization (with uncertainties):\n\n');
    617 fprintf(1,'Focal Length:          fc = [ %3.5f   %3.5f ] ? [ %3.5f   %3.5f ]\n',[fc;fc_error]);
    618 fprintf(1,'Principal point:       cc = [ %3.5f   %3.5f ] ? [ %3.5f   %3.5f ]\n',[cc;cc_error]);
    619 fprintf(1,'Skew:             alpha_c = [ %3.5f ] ? [ %3.5f  ]   => angle of pixel axes = %3.5f ? %3.5f degrees\n',[alpha_c;alpha_c_error],90 - atan(alpha_c)*180/pi,atan(alpha_c_error)*180/pi);
    620 fprintf(1,'Distortion:            kc = [ %3.5f   %3.5f   %3.5f   %3.5f  %5.5f ] ? [ %3.5f   %3.5f   %3.5f   %3.5f  %5.5f ]\n',[kc;kc_error]);   
     597fprintf(1,'Focal Length:          fc = [ %3.5f   %3.5f ] +/- [ %3.5f   %3.5f ]\n',[fc;fc_error]);
     598fprintf(1,'Principal point:       cc = [ %3.5f   %3.5f ] +/- [ %3.5f   %3.5f ]\n',[cc;cc_error]);
     599fprintf(1,'Skew:             alpha_c = [ %3.5f ] +/- [ %3.5f  ]   => angle of pixel axes = %3.5f +/- %3.5f degrees\n',[alpha_c;alpha_c_error],90 - atan(alpha_c)*180/pi,atan(alpha_c_error)*180/pi);
     600fprintf(1,'Distortion:            kc = [ %3.5f   %3.5f   %3.5f   %3.5f  %5.5f ] +/- [ %3.5f   %3.5f   %3.5f   %3.5f  %5.5f ]\n',[kc;kc_error]);   
    621601fprintf(1,'Pixel error:          err = [ %3.5f   %3.5f ]\n\n',err_std);
    622602fprintf(1,'Note: The numerical errors are approximately three times the standard deviations (for reference).\n\n\n')
     
    630610alpha_c_max = alpha_c + alpha_c_error/2;
    631611
    632 if (alpha_c_min < 0) & (alpha_c_max > 0),
     612if (alpha_c_min < 0) && (alpha_c_max > 0),
    633613    fprintf(1,'Recommendation: The skew coefficient alpha_c is found to be equal to zero (within its uncertainty).\n');
    634614    fprintf(1,'                You may want to reject it from the optimization by setting est_alpha=0 and run Calibration\n\n');
     
    640620prob_kc = (kc_min < 0) & (kc_max > 0);
    641621
    642 if ~(prob_kc(3) & prob_kc(4))
     622if ~(prob_kc(3) && prob_kc(4))
    643623    prob_kc(3:4) = [0;0];
    644624end;
Note: See TracChangeset for help on using the changeset viewer.