source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/zisserman/vgg_multiview/vgg_F_from_P.m @ 37

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

Added original make3d

  • Property svn:executable set to *
File size: 697 bytes
Line 
1%F = vgg_F_from_P(P)  Compute fundamental matrix from two camera matrices.
2%   P is cell (2), P = {P1 P2}. F has size (3,3). It is x2'*F*x1 = 0
3%
4%   Overall scale of F is unique and such that, for any X, P1, P2, it is
5%   F*x1 = vgg_contreps(e2)*x2, where
6%   x1 = P1*X, x2 = P2*X, e2 = P2*C1, C1 = vgg_wedge(P1).
7
8function F = vgg_F_from_P(P, P2)
9
10if nargin == 1
11  P1 = P{1};
12  P2 = P{2};
13else
14  P1 = P;
15end
16
17X1 = P1([2 3],:);
18X2 = P1([3 1],:);
19X3 = P1([1 2],:);
20Y1 = P2([2 3],:);
21Y2 = P2([3 1],:);
22Y3 = P2([1 2],:);
23
24F = [det([X1; Y1]) det([X2; Y1]) det([X3; Y1])
25     det([X1; Y2]) det([X2; Y2]) det([X3; Y2])
26     det([X1; Y3]) det([X2; Y3]) det([X3; Y3])];
27
28return
Note: See TracBrowser for help on using the repository browser.