source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/torr/torr_esth.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 737 bytes
Line 
1%
2% %designed for the good of the world by Philip Torr
3% copyright Philip Torr and Microsoft Corp 2002
4% linear estimation of H
5
6function h = torr_esth(x1,y1,x2,y2,no_matches,m3)
7% estimate homography
8
9   A(:,1) = x1(:) *m3;
10   A(:,2) = y1(:) *m3;
11   A(:,3) = m3 *m3;
12   
13   A(:,4) = 0;
14   A(:,5) = 0;
15   A(:,6) = 0;
16   
17   A(:,7) = x1(:) .* x2(:);
18   A(:,8) = y1(:) .* x2(:);
19   A(:,9) = m3    * x2(:);
20
21   
22   B(:,4) = x1(:) *m3;
23   B(:,5) = y1(:) *m3;
24   B(:,6) = m3 *m3;
25   
26   B(:,7) = x1(:) .* y2(:);
27   B(:,8) = y1(:) .* y2(:);
28   B(:,9) = m3    * y2(:);
29   
30   
31   B(:,1) = 0;
32   B(:,2) = 0;
33   B(:,3) = 0;
34
35
36C = [A; B];
37
38% we want to call least squares for C
39
40h = torr_ls(C);
41
42%C * v
Note: See TracBrowser for help on using the repository browser.