Changeset 926 for trunk/src/toolbox_calib/go_calib_optim_iter.m
 Timestamp:
 Feb 18, 2016, 12:05:51 PM (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/toolbox_calib/go_calib_optim_iter.m
r924 r926 1 %=======================================================================2 % Copyright 20082016, LEGI UMR 5519 / CNRS UGA GINP, Grenoble, France3 % http://www.legi.grenobleinp.fr4 % Joel.Sommeria  Joel.Sommeria (A) legi.cnrs.fr5 %6 % This file is part of the toolbox UVMAT.7 %8 % UVMAT is free software; you can redistribute it and/or modify9 % it under the terms of the GNU General Public License as published10 % 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 of15 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 % GNU General Public License (see LICENSE.txt) for more details.17 %=======================================================================18 19 1 %go_calib_optim_iter 20 2 % … … 114 96 check_active_images; 115 97 98 116 99 quick_init = 0; % Set to 1 for using a quick init (necessary when using 3D rigs) 117 100 … … 169 152 if isequal(est_fc,[0;1]), 170 153 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 172 155 fprintf(1,'The focal vector fc is not optimized (est_fc=[0;0])\n'); 173 156 end; … … 236 219 237 220 alpha_smooth = 0.1; % set alpha_smooth = 1; for steepest gradient descent 238 % alpha_smooth = 0.01; % modified L. Gostiaux239 221 240 222 241 223 % Conditioning threshold for view rejection 242 thresh_cond = 1e 5;224 thresh_cond = 1e6; 243 225 244 226 … … 260 242 end; 261 243 262 263 264 244 if ~exist('alpha_c'), 265 245 fprintf(1,'Initialization of the image skew to zero.\n'); … … 268 248 end; 269 249 270 if ~exist('fc') & quick_init,250 if ~exist('fc') && quick_init, 271 251 FOV_angle = 35; % Initial camera field of view in degrees 272 252 fprintf(1,['Initialization of the focal length to a FOV of ' num2str(FOV_angle) ' degrees.\n']); … … 340 320 341 321 342 while (change > 1e 2)&(iter < MaxIter),322 while (change > 1e9) && (iter < MaxIter), 343 323 344 324 fprintf(1,'%d...',iter+1); … … 602 582 solution_error = param_error; 603 583 604 if ~est_aspect_ratio & isequal(est_fc,[1;1]),584 if ~est_aspect_ratio && isequal(est_fc,[1;1]), 605 585 solution_error(2) = solution_error(1); 606 586 end; … … 615 595 616 596 fprintf(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]);597 fprintf(1,'Focal Length: fc = [ %3.5f %3.5f ] +/ [ %3.5f %3.5f ]\n',[fc;fc_error]); 598 fprintf(1,'Principal point: cc = [ %3.5f %3.5f ] +/ [ %3.5f %3.5f ]\n',[cc;cc_error]); 599 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); 600 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]); 621 601 fprintf(1,'Pixel error: err = [ %3.5f %3.5f ]\n\n',err_std); 622 602 fprintf(1,'Note: The numerical errors are approximately three times the standard deviations (for reference).\n\n\n') … … 630 610 alpha_c_max = alpha_c + alpha_c_error/2; 631 611 632 if (alpha_c_min < 0) & (alpha_c_max > 0),612 if (alpha_c_min < 0) && (alpha_c_max > 0), 633 613 fprintf(1,'Recommendation: The skew coefficient alpha_c is found to be equal to zero (within its uncertainty).\n'); 634 614 fprintf(1,' You may want to reject it from the optimization by setting est_alpha=0 and run Calibration\n\n'); … … 640 620 prob_kc = (kc_min < 0) & (kc_max > 0); 641 621 642 if ~(prob_kc(3) & prob_kc(4))622 if ~(prob_kc(3) && prob_kc(4)) 643 623 prob_kc(3:4) = [0;0]; 644 624 end;
Note: See TracChangeset
for help on using the changeset viewer.