Part 1: load and draw the original images 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
import numpy as np | |
import cv2 as cv | |
import matplotlib.pyplot as plt | |
# Read both images and convert to grayscale | |
img1 = cv.imread('left_img.png', cv.IMREAD_GRAYSCALE) | |
img2 = cv.imread('right_img.png', cv.IMREAD_GRAYSCALE) | |
# ------------------------------------------------------------ | |
# PREPROCESSING | |
# Compare unprocessed images | |
fig, axes = plt.subplots(1, 2, figsize=(15, 10)) | |
axes[0].imshow(img1, cmap="gray") | |
axes[1].imshow(img2, cmap="gray") | |
axes[0].axhline(250) | |
axes[1].axhline(250) | |
axes[0].axhline(450) | |
axes[1].axhline(450) | |
plt.suptitle("Original images") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment