Line | |
---|
1 | % By Philip Torr 2002
|
---|
2 | % copyright Microsoft Corp.
|
---|
3 | %this function will convert an essential matrix to a rotation and translation martix
|
---|
4 | %as set out in Hartley and Zisserman.
|
---|
5 |
|
---|
6 | %note there are 4 solutions in all, two (for sign of translation) times 2 for 2 different rotation matrices,
|
---|
7 |
|
---|
8 | %note E + T_x R
|
---|
9 |
|
---|
10 | function [Tx,R1,R2] = torr_EtoRt(E)
|
---|
11 |
|
---|
12 | [U,S,V] = svd(E);
|
---|
13 |
|
---|
14 |
|
---|
15 | %use Hartley matrices:
|
---|
16 | W = [0 -1 0; 1 0 0; 0 0 1];
|
---|
17 | Z = [0 1 0; -1 0 0; 0 0 0];
|
---|
18 |
|
---|
19 | Tx = U * Z * U';
|
---|
20 |
|
---|
21 | R1 = U * W * V';
|
---|
22 |
|
---|
23 | R2 = U * W' * V';
|
---|
24 |
|
---|
25 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.