1 | %=======================================================================
|
---|
2 | % Copyright 2008-2014, LEGI UMR 5519 / CNRS UJF G-INP, Grenoble, France
|
---|
3 | % http://www.legi.grenoble-inp.fr
|
---|
4 | % Joel.Sommeria - Joel.Sommeria (A) legi.cnrs.fr
|
---|
5 | %
|
---|
6 | % This file is part of the toolbox UVMAT.
|
---|
7 | %
|
---|
8 | % UVMAT is free software; you can redistribute it and/or modify
|
---|
9 | % it under the terms of the GNU General Public License as published
|
---|
10 | % by the Free Software Foundation; either version 2 of the license,
|
---|
11 | % or (at your option) any later version.
|
---|
12 | %
|
---|
13 | % UVMAT is distributed in the hope that it will be useful,
|
---|
14 | % but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | % GNU General Public License (see LICENSE.txt) for more details.
|
---|
17 | %=======================================================================
|
---|
18 |
|
---|
19 | %%%%%%%%%%%%%%%%%%%% RECOMPUTES THE REPROJECTION ERROR %%%%%%%%%%%%%%%%%%%%%%%%
|
---|
20 |
|
---|
21 | check_active_images;
|
---|
22 |
|
---|
23 | % Reproject the patterns on the images, and compute the pixel errors:
|
---|
24 |
|
---|
25 | ex = []; % Global error vector
|
---|
26 | x = []; % Detected corners on the image plane
|
---|
27 | y = []; % Reprojected points
|
---|
28 |
|
---|
29 | if ~exist('alpha_c'),
|
---|
30 | alpha_c = 0;
|
---|
31 | end;
|
---|
32 |
|
---|
33 | for kk = 1:n_ima,
|
---|
34 |
|
---|
35 | eval(['omckk = omc_' num2str(kk) ';']);
|
---|
36 | eval(['Tckk = Tc_' num2str(kk) ';']);
|
---|
37 |
|
---|
38 | if active_images(kk) & (~isnan(omckk(1,1))),
|
---|
39 |
|
---|
40 | %Rkk = rodrigues(omckk);
|
---|
41 |
|
---|
42 | eval(['y_' num2str(kk) ' = project_points2(X_' num2str(kk) ',omckk,Tckk,fc,cc,kc,alpha_c);']);
|
---|
43 |
|
---|
44 | eval(['ex_' num2str(kk) ' = x_' num2str(kk) ' - y_' num2str(kk) ';']);
|
---|
45 |
|
---|
46 | eval(['x_kk = x_' num2str(kk) ';']);
|
---|
47 |
|
---|
48 | eval(['ex = [ex ex_' num2str(kk) '];']);
|
---|
49 | eval(['x = [x x_' num2str(kk) '];']);
|
---|
50 | eval(['y = [y y_' num2str(kk) '];']);
|
---|
51 |
|
---|
52 | else
|
---|
53 |
|
---|
54 | % eval(['y_' num2str(kk) ' = NaN*ones(2,1);']);
|
---|
55 |
|
---|
56 |
|
---|
57 | % If inactivated image, the error does not make sense:
|
---|
58 | eval(['ex_' num2str(kk) ' = NaN*ones(2,1);']);
|
---|
59 |
|
---|
60 | end;
|
---|
61 |
|
---|
62 | end;
|
---|
63 |
|
---|
64 | err_std = std(ex')';
|
---|