source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/torr/torr_g2FP.m @ 37

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

Added original make3d

File size: 755 bytes
Line 
1%       By Philip Torr 2002
2%       copyright Microsoft Corp.
3
4
5
6%
7% %here p is the set of paramets such that
8% g(1) = focal length
9% g(2-3) sperical coordinates of rotation axis
10% g(4) rotation angle
11% g(5-6) is the translation vector
12
13
14
15function [P1, P2] = torr_g2FP(g,C)
16
17%convert intrinsic and extinsics to a F matrix
18C(3,3) = 1/g(1);
19rot_axis = torr_sphere2unit([g(2) g(3)]);
20tt = torr_sphere2unit([g(5) g(6)]);
21rot_angle = g(4);
22
23%Rogregues
24II = [1 0 0; 0 1 0; 0 0 1];
25AX = torr_skew_sym(rot_axis);
26RR = cos(rot_angle) * II +sin(rot_angle) * AX + (1 - cos(rot_angle)) * rot_axis * rot_axis';
27%
28% TX = torr_skew_sym(tt);
29% nnE = TX * RR;
30%
31% F = inv(C') *  nnE * inv(C);
32% f = reshape(F',9,1);
33
34[P1, P2] = torr_RCT2P(C,RR,tt);
Note: See TracBrowser for help on using the repository browser.