source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/zisserman/vgg_multiview/vgg_plane_from_2P_H.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: 738 bytes
Line 
1% A = vgg_plane_from_2P_H(P1,P2,H)  From two cameras and inter-image homography, it gets the scene plane.
2%
3% The method is linear and there is no preconditioning - works only for consistent triplet (P1,P2,H).
4%
5% P1, P2 ... double (3,4)
6% H ... double (3,3)
7% A ... double (4,1)
8%
9% It is H = P2*vgg_H_from_2P_plane(A,P1). Try the example at the end of this file.
10
11function A = vgg_plane_from_2P_H(P,P2,H)
12
13Q = [P2*vgg_contreps(P(2,:)'*P(3,:) - P(3,:)'*P(2,:))
14     P2*vgg_contreps(P(3,:)'*P(1,:) - P(1,:)'*P(3,:))
15     P2*vgg_contreps(P(1,:)'*P(2,:) - P(2,:)'*P(1,:))];
16A = (Q\H(:))';
17
18return
19
20
21P = randn(3,4);
22P2 = randn(3,4);
23A = randn(1,4);
24H = P2*vgg_H_from_P_plane(A,P);
25vgg_plane_from_2P_H(P,P2,H) ./ A
26
Note: See TracBrowser for help on using the repository browser.