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 |
|
---|
15 | function [P1, P2] = torr_g2FP(g,C)
|
---|
16 |
|
---|
17 | %convert intrinsic and extinsics to a F matrix
|
---|
18 | C(3,3) = 1/g(1);
|
---|
19 | rot_axis = torr_sphere2unit([g(2) g(3)]);
|
---|
20 | tt = torr_sphere2unit([g(5) g(6)]);
|
---|
21 | rot_angle = g(4);
|
---|
22 |
|
---|
23 | %Rogregues
|
---|
24 | II = [1 0 0; 0 1 0; 0 0 1];
|
---|
25 | AX = torr_skew_sym(rot_axis);
|
---|
26 | RR = 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.