source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/BlueCCal/MultiCamSelfCal/MartinecPajdla/fill_mm/M2Fe.m @ 37

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

Added original make3d

File size: 1.3 KB
Line 
1%M2Fe Estimate epipolar geometry of MM in sequence or using the central image.
2%
3%  [F,e,rows,nonrows] = M2Fe(M, central)
4%
5%     Parametres:
6%       central ... If zero, the concept of sequence is used otherwise the
7%                   concept of the central image is used with central
8%                   image number ``central''.
9
10function [F,ep,rows,nonrows] = M2Fe(M, central)
11
12m = size(M,1)/3; nonrows = []; F = []; ep = [];
13
14if central, rows = [1:central-1, central+1:m];
15else,       rows = [2:m]; end
16
17%estimate the fundamental matrices and epipoles with the method of [Har95]
18for k = rows
19  if central, j = central;
20  else,       j = k-1; end
21  G = u2FI([M(3*k-2:3*k,:);M(3*j-2:3*j,:)], 'donorm');
22  if G==0
23    rows    = setdiff(rows,k);
24    nonrows = [nonrows k];
25  else
26    %ep=null(G');  %it must be transposed otherwise it's the second epipole
27    % sometimes returns empty matrix => compute it "by hand" by svd
28    [u,s,v] = svd(G);
29    epip = u(:,3);
30   
31    F(k,j,1:3,1:3) = G;
32    ep(k,j,1:3) = epip;
33  end
34end
35
36if central, rows = union(rows, central);
37else rows = [1 rows]; end
38 
39if ~isempty(nonrows) & ~central  % find the longest continuous subsequence
40  I_(rows,1) = 1;
41  [b, len] = subseq_longest(I_);
42  rows = b:b+len-1;
43  nonrows = setdiff(1:m, rows);
44end
Note: See TracBrowser for help on using the repository browser.