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
|
Rev | Line | |
---|
[37] | 1 | function 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 |
|
---|
| 8 | if (size(X1) ~= size(X2))
|
---|
| 9 | error('Point sets not same size!');
|
---|
| 10 | end
|
---|
| 11 |
|
---|
| 12 | N = size(X1,2);
|
---|
| 13 |
|
---|
| 14 | Dx = [ X1' .* repmat(X2(3,:)',1,3) , zeros(N,3) , -X1' .* repmat(X2(1,:)',1,3) ];
|
---|
| 15 |
|
---|
| 16 | Dy = [ zeros(N,3) , X1' .* repmat(X2(3,:)',1,3) , -X1' .* repmat(X2(2,:)',1,3) ];
|
---|
| 17 |
|
---|
| 18 | h = reshape(H',9,1);
|
---|
| 19 |
|
---|
| 20 | d = [Dx * h , Dy * h]'; |
---|
Note: See
TracBrowser
for help on using the repository browser.