Estimate a homography from correspondences contaminated by outliers with RANSAC. The random part is taken out of your hands: the caller passes the minimal samples to try, so the result is deterministic.
Implement:
ransac_iterations(p, w, s): the number of random samples needed to draw at least one all-inlier sample of size with probability when the inlier ratio is : , and at least . Return an int. Inputs satisfy and .ransac_homography(src, dst, samples, threshold) for (N, 2) point arrays and an integer array samples of shape (K, 4) holding index quadruples:
threshold.Return (H, inliers): the refit homography scaled so , and the boolean (N,) inlier mask of the best sample (the set used for the refit). Every sample in the tests is non-degenerate and every best sample has at least 4 inliers.