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

Last change on this file since 1063 was 1000, checked in by g7moreau, 7 years ago
  • Remove tab
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        omckk = solution(15+6*(kk-1) + 1:15+6*(kk-1) + 3);%***
31        Tckk = solution(15+6*(kk-1) + 4:15+6*(kk-1) + 6);%***
32
33        omckk_error = solution_error(15+6*(kk-1) + 1:15+6*(kk-1) + 3);
34        Tckk_error = solution_error(15+6*(kk-1) + 4:15+6*(kk-1) + 6);
35
36        Rckk = rodrigues(omckk);
37
38        Hkk = KK * [Rckk(:,1) Rckk(:,2) Tckk];
39
40        Hkk = Hkk / Hkk(3,3);
41
42    else
43        omckk = NaN*ones(3,1);
44        Tckk = NaN*ones(3,1);
45        Rckk = NaN*ones(3,3);
46        Hkk = NaN*ones(3,3);
47        omckk_error = NaN*ones(3,1);
48        Tckk_error = NaN*ones(3,1);
49    end;
50
51    eval(['omc_' num2str(kk) ' = omckk;']);
52    eval(['Rc_' num2str(kk) ' = Rckk;']);
53    eval(['Tc_' num2str(kk) ' = Tckk;']);
54    eval(['H_' num2str(kk) '= Hkk;']);
55    eval(['omc_error_' num2str(kk) ' = omckk_error;']);
56    eval(['Tc_error_' num2str(kk) ' = Tckk_error;']);
57end;
Note: See TracBrowser for help on using the repository browser.