function [ err] = check2DHomography(H, p1,p2 ) %B. Vandeportaele %compute the error in R2 (after deshomogeneisation) for every points %contained in p1 and p2 matrices considering the homography H %err= p2 -deshomogenieisation(H.p1) err=[]; for i=1:size(p1,2) u11=p1(1,i); v11=p1(2,i); wuv21p=H*[u11;v11;1]; err(1,i)=p2(1,i)-(wuv21p(1)/wuv21p(3)); err(2,i)=p2(2,i)-(wuv21p(2)/wuv21p(3)); end end