source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/zisserman/vgg_multiview/vgg_H_algebraic_distance.m @ 37

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

Added original make3d

  • Property svn:executable set to *
File size: 528 bytes
Line 
1function d = vgg_H_algebraic_distance(H,X1,X2)
2
3% d = vgg_H_algebraic_distance(H,X1,X2)
4%
5% For sets of homg points X1 and X2, returns the algebraic distances
6%  d = (p2'_x p2'_y) * p1_w - (p1_x p1_y) * p2'_w
7 
8if (size(X1) ~= size(X2))
9  error('Point sets not same size!');
10end
11
12N = size(X1,2);
13
14Dx = [ X1' .* repmat(X2(3,:)',1,3) , zeros(N,3) , -X1' .* repmat(X2(1,:)',1,3) ];
15
16Dy = [ zeros(N,3) , X1' .* repmat(X2(3,:)',1,3) , -X1' .* repmat(X2(2,:)',1,3) ];
17
18h = reshape(H',9,1);
19
20d = [Dx * h , Dy * h]';
Note: See TracBrowser for help on using the repository browser.