In this recipe, we estimate homography model parameters between two images using the robust RANSAC algorithm. It's done through the cv2.findHomography function with the cv2.RANSAC parameter. The function returns a homography transformation estimated by point correspondences as well as the inliers mask. The inlier mask deals with correspondences that satisfy the estimated motion model with a low enough error. In our case, the error is computed as a Euclidean distance between the matched point and the corresponding point transformed according to the motion model.
The following is the expected output: