Calculate the fundamental matrix for stereo rectification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------ | |
# STEREO RECTIFICATION | |
# Calculate the fundamental matrix for the cameras | |
# https://docs.opencv.org/master/da/de9/tutorial_py_epipolar_geometry.html | |
pts1 = np.int32(pts1) | |
pts2 = np.int32(pts2) | |
fundamental_matrix, inliers = cv.findFundamentalMat(pts1, pts2, cv.FM_RANSAC) | |
# We select only inlier points | |
pts1 = pts1[inliers.ravel() == 1] | |
pts2 = pts2[inliers.ravel() == 1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment