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:
![](assets/cd27d86e-f509-4cfe-a8e3-673fd79ea9d3.png)