def H_from_ransac(fp, tp, model, maxiter=1000, match_theshold=10):
    ' Robust estimation of homography H from point \n        correspondences using RANSAC (ransac.py from\n        http://www.scipy.org/Cookbook/RANSAC).\n        \n        input: fp,tp (3*n arrays) points in hom. coordinates. '
    from PCV.tools import ransac
    data = vstack((fp, tp))
    (H, ransac_data) = ransac.ransac(data.T, model, 4, maxiter, match_theshold, 10, return_all=True)
    return (H, ransac_data['inliers'])
Robust estimation of homography H from point 
correspondences using RANSAC (ransac.py from
http://www.scipy.org/Cookbook/RANSAC).

input: fp,tp (3*n arrays) points in hom. coordinates.
def H_from_ransac(fp, tp, model, maxiter=1000, match_theshold=10):
    ' Robust estimation of homography H from point \n        correspondences using RANSAC (ransac.py from\n        http://www.scipy.org/Cookbook/RANSAC).\n        \n        input: fp,tp (3*n arrays) points in hom. coordinates. '
    from PCV.tools import ransac
    data = vstack((fp, tp))
    (H, ransac_data) = ransac.ransac(data.T, model, 4, maxiter, match_theshold, 10, return_all=True)
    return (H, ransac_data['inliers'])