TP-vision/distance_homographie.m

15 lines
276 B
Mathematica
Raw Permalink Normal View History

2023-06-25 14:42:57 +00:00
function d = distance_homographie(XY1, XY2, H)
Hinv = inv(H);
Hinv = Hinv ./ Hinv(3, 3);
XY1_ = appliquerHomographie(H, XY1);
XY2_ = appliquerHomographie(Hinv, XY2);
d1 = sum((XY1_ - XY2).^2, 2);
d2 = sum((XY2_ - XY1).^2, 2);
d = d1 + d2;
end