/** * Estimates the homography from view 1 to view 2 induced by a plane from 3 point associations. * Each pair must pass the epipolar constraint. This can fail if the points are colinear. * * @param p1 Associated point observation * @param p2 Associated point observation * @param p3 Associated point observation * @return True if successful or false if it failed */ public boolean process(AssociatedPair p1, AssociatedPair p2, AssociatedPair p3) { // Fill rows of M with observations from image 1 fillM(p1.p1,p2.p1,p3.p1); // Compute 'b' vector b.x = computeB(p1.p2); b.y = computeB(p2.p2); b.z = computeB(p3.p2); // A_inv_b = inv(A)*b if( !solver.setA(M) ) return false; GeometryMath_F64.toMatrix(b,temp0); solver.solve(temp0,temp1); GeometryMath_F64.toTuple3D(temp1, A_inv_b); GeometryMath_F64.addOuterProd(A, -1, e2, A_inv_b, H); // pick a good scale and sign for H adjust.adjust(H, p1); return true; }
/** * Estimates the homography from view 1 to view 2 induced by a plane from 3 point associations. * Each pair must pass the epipolar constraint. This can fail if the points are colinear. * * @param p1 Associated point observation * @param p2 Associated point observation * @param p3 Associated point observation * @return True if successful or false if it failed */ public boolean process(AssociatedPair p1, AssociatedPair p2, AssociatedPair p3) { // Fill rows of M with observations from image 1 fillM(p1.p1,p2.p1,p3.p1); // Compute 'b' vector b.x = computeB(p1.p2); b.y = computeB(p2.p2); b.z = computeB(p3.p2); // A_inv_b = inv(A)*b if( !solver.setA(M) ) return false; GeometryMath_F64.toMatrix(b,temp0); solver.solve(temp0,temp1); GeometryMath_F64.toTuple3D(temp1, A_inv_b); GeometryMath_F64.addOuterProd(A, -1, e2, A_inv_b, H); // pick a good scale and sign for H adjust.adjust(H, p1); return true; }