You need to complete the following steps:
- Import the necessary modules:
import cv2import numpy as np
- Load the left/right image point correspondences and the individual camera calibration parameters:
data = np.load('../data/stereo/case1/stereo.npy').item()Kl, Kr, Dl, Dr, left_pts, right_pts, E_from_stereo, F_from_stereo = \ data['Kl'], data['Kr'], data['Dl'], data['Dr'], \ data['left_pts'], data['right_pts'], data['E'], data['F']
- Stack the left and right point lists into arrays:
left_pts = np.vstack(left_pts)right_pts = np.vstack(right_pts)
- Get rid of lens distortions:
left_pts = cv2.undistortPoints(left_pts, Kl, Dl, P=Kl)right_pts = cv2.undistortPoints(right_pts, Kr, Dr, P=Kr)
- Estimate the fundamental matrix:
F, mask ...