Skip to content

Instantly share code, notes, and snippets.

@andijakl
Last active April 20, 2022 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andijakl/93f85969dc6de8f9595941b5d63430da to your computer and use it in GitHub Desktop.
Save andijakl/93f85969dc6de8f9595941b5d63430da to your computer and use it in GitHub Desktop.
Stereo Rectification through OpenCV in the uncalibrated variant. Full article for context and remaining code: https://www.andreasjakl.com/understand-and-apply-stereo-rectification-for-depth-maps-part-2/
# Stereo rectification (uncalibrated variant)
# Adapted from: https://stackoverflow.com/a/62607343
h1, w1 = img1.shape
h2, w2 = img2.shape
_, H1, H2 = cv.stereoRectifyUncalibrated(
np.float32(pts1), np.float32(pts2), fundamental_matrix, imgSize=(w1, h1)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment