Rev | Line | |
---|
[37] | 1 | % By Philip Torr 2002
|
---|
| 2 | % copyright Microsoft Corp.
|
---|
| 3 | %this function will convert an fundamental matrix to a rotation and translation martix
|
---|
| 4 | %then establish a suitable frame eliminating the spurious solutions using constraints
|
---|
| 5 | %as set out in Hartley and Zisserman.
|
---|
| 6 | %and a suitable self calibration method!
|
---|
| 7 |
|
---|
| 8 | %note E + T_x R
|
---|
| 9 | %%%
|
---|
| 10 | %F is the fundamental matrix, C is the calibration matrix
|
---|
| 11 | % C = 1 0 x_0
|
---|
| 12 | % 0 1 y_0
|
---|
| 13 | % 0 0 1/f
|
---|
| 14 | %where 1/f is the best estimate so far of the focal length
|
---|
| 15 |
|
---|
| 16 | %also returns the structure
|
---|
| 17 |
|
---|
| 18 | function [P1,P2,X] = torr_FtoP(F,C, matches)
|
---|
| 19 |
|
---|
| 20 | focal_lenth = torr_self_calib_f(F,C);
|
---|
| 21 |
|
---|
| 22 | [Tx,R1,R2] = torr_EtoRt(E)
|
---|
| 23 |
|
---|
| 24 | %next correct the matches to make them lie on the optimal epipolar lines
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 |
|
---|
| 28 | %next solve for one of the four possible solutions:
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 | Tx
|
---|
| 32 | R1
|
---|
| 33 | R2
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 | P1 = ones(3,4);
|
---|
| 37 | P2 = ones(3,4);
|
---|
| 38 |
|
---|
| 39 |
|
---|
| 40 | %next we need to look at a single point to determine if it is front of both cameras; |
---|
Note: See
TracBrowser
for help on using the repository browser.