source: trunk/src/toolbox_calib/comp_error_calib.m @ 810

Last change on this file since 810 was 810, checked in by g7moreau, 9 years ago
  • Add license
File size: 2.0 KB
RevLine 
[810]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
[732]19%%%%%%%%%%%%%%%%%%%% RECOMPUTES THE REPROJECTION ERROR %%%%%%%%%%%%%%%%%%%%%%%%
20
21check_active_images;
22
23% Reproject the patterns on the images, and compute the pixel errors:
24
25ex = []; % Global error vector
26x = []; % Detected corners on the image plane
27y = []; % Reprojected points
28
29if ~exist('alpha_c'),
30   alpha_c = 0;
31end;
32
33for 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   
62end;
63
64err_std = std(ex')';
Note: See TracBrowser for help on using the repository browser.