[926] | 1 | |
---|
| 2 | %%% Extraction of the final intrinsic and extrinsic paramaters: |
---|
| 3 | |
---|
| 4 | check_active_images; |
---|
| 5 | |
---|
| 6 | if ~exist('solution_error') |
---|
[1000] | 7 | solution_error = zeros(6*n_ima + 15,1); |
---|
[926] | 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: |
---|
[1000] | 21 | |
---|
[926] | 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, |
---|
[1000] | 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;']); |
---|
[926] | 57 | end; |
---|