source: trunk/src/toolbox_calib/extract_parameters.m @ 968

Last change on this file since 968 was 926, checked in by sommeria, 8 years ago

geometry cqlib updated

File size: 1.5 KB
Line 
1
2%%% Extraction of the final intrinsic and extrinsic paramaters:
3
4check_active_images;
5
6if ~exist('solution_error')
7   solution_error = zeros(6*n_ima + 15,1);
8end;
9
10fc = solution(1:2);%***
11cc = solution(3:4);%***
12alpha_c = solution(5);%***
13kc = solution(6:10);%***
14
15fc_error = solution_error(1:2);
16cc_error = solution_error(3:4);
17alpha_c_error = solution_error(5);
18kc_error = solution_error(6:10);
19
20% Calibration matrix:
21       
22KK = [fc(1) fc(1)*alpha_c cc(1);0 fc(2) cc(2); 0 0 1];
23inv_KK = inv(KK);
24
25% Extract the extrinsic paramters, and recomputer the collineations
26
27for kk = 1:n_ima,
28   
29   if active_images(kk),   
30     
31      omckk = solution(15+6*(kk-1) + 1:15+6*(kk-1) + 3);%***   
32      Tckk = solution(15+6*(kk-1) + 4:15+6*(kk-1) + 6);%***
33     
34      omckk_error = solution_error(15+6*(kk-1) + 1:15+6*(kk-1) + 3);
35      Tckk_error = solution_error(15+6*(kk-1) + 4:15+6*(kk-1) + 6);
36     
37        Rckk = rodrigues(omckk);
38   
39        Hkk = KK * [Rckk(:,1) Rckk(:,2) Tckk];
40   
41        Hkk = Hkk / Hkk(3,3);
42     
43   else
44     
45      omckk = NaN*ones(3,1);   
46      Tckk = NaN*ones(3,1);
47      Rckk = NaN*ones(3,3);
48      Hkk = NaN*ones(3,3);
49      omckk_error = NaN*ones(3,1);
50      Tckk_error = NaN*ones(3,1);
51     
52   end;
53   
54   eval(['omc_' num2str(kk) ' = omckk;']);
55   eval(['Rc_' num2str(kk) ' = Rckk;']);
56   eval(['Tc_' num2str(kk) ' = Tckk;']);
57   eval(['H_' num2str(kk) '= Hkk;']);
58   eval(['omc_error_' num2str(kk) ' = omckk_error;']);
59   eval(['Tc_error_' num2str(kk) ' = Tckk_error;']);
60   
61end;
Note: See TracBrowser for help on using the repository browser.