source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/BlueCCal/MultiCamSelfCal/CoreFunctions/reprerror.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 1.1 KB
Line 
1% reprerror   Estimate reprojection error
2%
3% [cam] = reprerror(cam,Pe,Xe,FRAMES,inliers);
4%
5% $Id: reprerror.m,v 2.0 2003/06/19 12:06:50 svoboda Exp $
6
7function [cam] = reprerror(cam,Pe,Xe,FRAMES,inliers);
8
9CAMS = size(Pe,1)/3;
10
11for i=1:CAMS,
12        xe              = Pe(((3*i)-2):(3*i),:)*Xe;
13        cam(i).xe       = xe./repmat(xe(3,:),3,1);
14        % these points were the input into Martinec and Pajdla filling
15        mask.rec = zeros(1,FRAMES);     % mask of points that survived validation so far
16        mask.vis = zeros(1,FRAMES); % maks of visible points
17        mask.rec(inliers.idx)  = 1;
18        mask.vis(cam(i).idlin) = 1;
19        mask.both                          = mask.vis & mask.rec; % which points are visible and reconstructed for a particular camera
20        unmask.rec                         = cumsum(mask.rec);
21        unmask.vis                         = cumsum(mask.vis);
22        cam(i).recandvis = unmask.rec(~xor(mask.rec,mask.both) & mask.rec);
23        cam(i).visandrec = unmask.vis(~xor(mask.rec,mask.both) & mask.rec);
24        cam(i).err2d     = sqrt(sum([cam(i).xe(1:2,cam(i).recandvis) - cam(i).xgt(1:2,cam(i).visandrec)].^2));
25        cam(i).mean2Derr = mean(cam(i).err2d);
26        cam(i).std2Derr  = std(cam(i).err2d);
27end
28
29return;
Note: See TracBrowser for help on using the repository browser.