Changeset 1110 for trunk/src/toolbox_calib
- Timestamp:
- Jan 20, 2022, 8:30:32 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/toolbox_calib/go_calib_optim_iter.m
r926 r1110 30 30 %For now, if using a 3D calibration rig, quick_init is set to 1 for an easy initialization of the focal length 31 31 32 if ~exist('desactivated_images' ),32 if ~exist('desactivated_images','var') 33 33 desactivated_images = []; 34 end; 35 36 37 38 if ~exist('est_aspect_ratio'), 34 end 35 36 if ~exist('est_aspect_ratio','var') 39 37 est_aspect_ratio = 1; 40 end ;41 42 if ~exist('est_fc' );38 end 39 40 if ~exist('est_fc','var') 43 41 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' ),42 end 43 44 if ~exist('recompute_extrinsic','var') 47 45 recompute_extrinsic = 1; % Set this variable to 0 in case you do not want to recompute the extrinsic parameters 48 46 % at each iterstion. 49 end ;50 51 if ~exist('MaxIter' ),47 end 48 49 if ~exist('MaxIter','var') 52 50 MaxIter = 30; % Maximum number of iterations in the gradient descent 53 51 end; 54 52 55 if ~exist('check_cond' ),53 if ~exist('check_cond','var'), 56 54 check_cond = 1; % Set this variable to 0 in case you don't want to extract view dynamically 57 55 end; 58 56 59 if ~exist('center_optim' ),57 if ~exist('center_optim','var'), 60 58 center_optim = 1; %%% Set this variable to 0 if your do not want to estimate the principal point 61 59 end; 62 60 63 if exist('est_dist' ),61 if exist('est_dist','var'), 64 62 if length(est_dist) == 4, 65 63 est_dist = [est_dist ; 0]; … … 67 65 end; 68 66 69 if ~exist('est_dist' ),67 if ~exist('est_dist','var'), 70 68 est_dist = [1;1;1;1;0]; 71 69 end; 72 70 73 if ~exist('est_alpha' ),71 if ~exist('est_alpha','var'), 74 72 est_alpha = 0; % by default, do not estimate skew 75 73 end; … … 87 85 fprintf(1,'\n'); 88 86 89 if ~exist('nx' )&~exist('ny'),87 if ~exist('nx','var')&~exist('ny','var'), 90 88 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'); 91 89 nx = 640; … … 116 114 end; 117 115 118 if ~exist('dont_ask' ),116 if ~exist('dont_ask','var'), 119 117 dont_ask = 0; 120 118 end; … … 161 159 if ~center_optim, % In the case where the principal point is not estimated, keep it at the center of the image 162 160 fprintf(1,'Principal point not optimized (center_optim=0). '); 163 if ~exist('cc' ),161 if ~exist('cc','var'), 164 162 fprintf(1,'It is kept at the center of the image.\n'); 165 163 cc = [(nx-1)/2;(ny-1)/2]; … … 228 226 % Initialization of the intrinsic parameters (if necessary) 229 227 230 if ~exist('cc' ),228 if ~exist('cc','var') 231 229 fprintf(1,'Initialization of the principal point at the center of the image.\n'); 232 230 cc = [(nx-1)/2;(ny-1)/2]; 233 231 alpha_smooth = 0.1; % slow convergence 234 end ;235 236 237 if exist('kc' ),238 if length(kc) == 4 ;232 end 233 234 235 if exist('kc','var') 236 if length(kc) == 4 239 237 fprintf(1,'Adding a new distortion coefficient to kc -> radial distortion model up to the 6th degree'); 240 238 kc = [kc;0]; 241 end ;242 end ;243 244 if ~exist('alpha_c' ),239 end 240 end 241 242 if ~exist('alpha_c','var') 245 243 fprintf(1,'Initialization of the image skew to zero.\n'); 246 244 alpha_c = 0; 247 245 alpha_smooth = 0.1; % slow convergence 248 end ;249 250 if ~exist('fc' ) && quick_init,246 end 247 248 if ~exist('fc','var') && quick_init 251 249 FOV_angle = 35; % Initial camera field of view in degrees 252 250 fprintf(1,['Initialization of the focal length to a FOV of ' num2str(FOV_angle) ' degrees.\n']); … … 254 252 est_fc = [1;1]; 255 253 alpha_smooth = 0.1; % slow 256 end ;257 258 259 if ~exist('fc' ),254 end 255 256 257 if ~exist('fc','var') 260 258 % Initialization of the intrinsic parameters: 261 259 fprintf(1,'Initialization of the intrinsic parameters using the vanishing points of planar patterns.\n') … … 263 261 alpha_smooth = 0.1; % slow convergence 264 262 est_fc = [1;1]; 265 end ;263 end 266 264 267 265
Note: See TracChangeset
for help on using the changeset viewer.