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 | function f = torr_g2F(g,C)
|
---|
14 |
|
---|
15 | %convert intrinsic and extinsics to a F matrix
|
---|
16 | C(3,3) = 1/g(1);
|
---|
17 | rot_axis = torr_sphere2unit([g(2) g(3)]);
|
---|
18 | tt = torr_sphere2unit([g(5) g(6)]);
|
---|
19 | rot_angle = g(4);
|
---|
20 |
|
---|
21 | %Rogregues
|
---|
22 | II = [1 0 0; 0 1 0; 0 0 1];
|
---|
23 | AX = torr_skew_sym(rot_axis);
|
---|
24 | RR = cos(rot_angle) * II +sin(rot_angle) * AX + (1 - cos(rot_angle)) * rot_axis * rot_axis';
|
---|
25 |
|
---|
26 | TX = torr_skew_sym(tt);
|
---|
27 | nnE = TX * RR;
|
---|
28 |
|
---|
29 | F = inv(C') * nnE * inv(C);
|
---|
30 | f = reshape(F',9,1);
|
---|
31 |
|
---|
32 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.