Last change
on this file since 177 was
37,
checked in by (none), 15 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 |
|
---|
8 | function F = vgg_F_from_P(P, P2)
|
---|
9 |
|
---|
10 | if nargin == 1
|
---|
11 | P1 = P{1};
|
---|
12 | P2 = P{2};
|
---|
13 | else
|
---|
14 | P1 = P;
|
---|
15 | end
|
---|
16 |
|
---|
17 | X1 = P1([2 3],:);
|
---|
18 | X2 = P1([3 1],:);
|
---|
19 | X3 = P1([1 2],:);
|
---|
20 | Y1 = P2([2 3],:);
|
---|
21 | Y2 = P2([3 1],:);
|
---|
22 | Y3 = P2([1 2],:);
|
---|
23 |
|
---|
24 | F = [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 |
|
---|
28 | return |
---|
Note: See
TracBrowser
for help on using the repository browser.