Rev | Line | |
---|
[37] | 1 | % By Philip Torr 2002
|
---|
| 2 | % copyright Microsoft Corp.
|
---|
| 3 | % estimate fundamental matrix from perfect points??
|
---|
| 4 |
|
---|
| 5 | function [ FA, fa] = torr_estfa(x1,y1,x2,y2, no_matches,m3)
|
---|
| 6 | %disp('This just does calculation of perfect data,for test')
|
---|
| 7 | %disp('Use estf otherwise')
|
---|
| 8 |
|
---|
| 9 | for(i = 1:no_matches)
|
---|
| 10 |
|
---|
| 11 | A(i,1) = x1(i);
|
---|
| 12 | A(i,2) = y1(i);
|
---|
| 13 | A(i,3) = x2(i);
|
---|
| 14 | A(i,4) = y2(i);
|
---|
| 15 |
|
---|
| 16 | end
|
---|
| 17 |
|
---|
| 18 | % centre data
|
---|
| 19 | centroid = mean(A);
|
---|
| 20 | B = A - ones(no_matches,1) * centroid;
|
---|
| 21 |
|
---|
| 22 | %est_F = [v(1) v(2) v(3); v(4) v(5) v(6); v(7) v(8) v(9)]
|
---|
| 23 | % need to check all this for whether it is right
|
---|
| 24 | v = torr_ls(B);
|
---|
| 25 | constant = - ( centroid * v)/m3;
|
---|
| 26 | fa = [v' constant] ;
|
---|
| 27 | %need to add constant term
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 | FA = [ 0 ,0, fa(3); 0, 0, fa(4); fa(1), fa(2), fa(5)];
|
---|
| 31 | %algebraic residuals
|
---|
| 32 | %r = A * v;
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 | %disp('This just does calculation of perfect data,for test')
|
---|
| 36 | %disp('Use estf otherwise')
|
---|
Note: See
TracBrowser
for help on using the repository browser.