-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomp_error_calib_fisheye.m
executable file
·46 lines (27 loc) · 1.13 KB
/
comp_error_calib_fisheye.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
%%%%%%%%%%%%%%%%%%%% RECOMPUTES THE REPROJECTION ERROR %%%%%%%%%%%%%%%%%%%%%%%%
check_active_images;
% Reproject the patterns on the images, and compute the pixel errors:
ex = []; % Global error vector
x = []; % Detected corners on the image plane
y = []; % Reprojected points
if ~exist('alpha_c'),
alpha_c = 0;
end;
for kk = 1:n_ima,
eval(['omckk = omc_' num2str(kk) ';']);
eval(['Tckk = Tc_' num2str(kk) ';']);
if active_images(kk) & (~isnan(omckk(1,1))),
%Rkk = rodrigues(omckk);
eval(['y_' num2str(kk) ' = project_points_fisheye(X_' num2str(kk) ',omckk,Tckk,fc,cc,kc,alpha_c);']);
eval(['ex_' num2str(kk) ' = x_' num2str(kk) ' - y_' num2str(kk) ';']);
eval(['x_kk = x_' num2str(kk) ';']);
eval(['ex = [ex ex_' num2str(kk) '];']);
eval(['x = [x x_' num2str(kk) '];']);
eval(['y = [y y_' num2str(kk) '];']);
else
% eval(['y_' num2str(kk) ' = NaN*ones(2,1);']);
% If inactivated image, the error does not make sense:
eval(['ex_' num2str(kk) ' = NaN*ones(2,1);']);
end;
end;
err_std = std(ex')';