1 |
|
---|
2 | %%% Extraction of the final intrinsic and extrinsic paramaters:
|
---|
3 |
|
---|
4 | check_active_images;
|
---|
5 |
|
---|
6 | if ~exist('solution_error')
|
---|
7 | solution_error = zeros(6*n_ima + 15,1);
|
---|
8 | end;
|
---|
9 |
|
---|
10 | fc = solution(1:2);%***
|
---|
11 | cc = solution(3:4);%***
|
---|
12 | alpha_c = solution(5);%***
|
---|
13 | kc = solution(6:10);%***
|
---|
14 |
|
---|
15 | fc_error = solution_error(1:2);
|
---|
16 | cc_error = solution_error(3:4);
|
---|
17 | alpha_c_error = solution_error(5);
|
---|
18 | kc_error = solution_error(6:10);
|
---|
19 |
|
---|
20 | % Calibration matrix:
|
---|
21 |
|
---|
22 | KK = [fc(1) fc(1)*alpha_c cc(1);0 fc(2) cc(2); 0 0 1];
|
---|
23 | inv_KK = inv(KK);
|
---|
24 |
|
---|
25 | % Extract the extrinsic paramters, and recomputer the collineations
|
---|
26 |
|
---|
27 | for 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 |
|
---|
61 | end;
|
---|