In [ ]:
points1 = np.int32(points1)
points2 = np.int32(points2)
# This is an important step. So here we need to find the fundamental matrix
F, mask = cv2.findFundamentalMat(points1,points2,cv2.FM_LMEDS)

print("Fundamental matrix:\n", F)

# We select only inlier points
points1 = points1[mask.ravel()==1]
points2 = points2[mask.ravel()==1]