You need to complete the following steps:
- Import the necessary modules:
import cv2import numpy as np
- Load the camera matrix, the distortion coefficients, and two frames taken by the camera:
camera_matrix = np.load('../data/pinhole_calib/camera_mat.npy')dist_coefs = np.load('../data/pinhole_calib/dist_coefs.npy')img_0 = cv2.imread('../data/pinhole_calib/img_00.png')img_1 = cv2.imread('../data/pinhole_calib/img_10.png')
- Undistort the frames:
img_0 = cv2.undistort(img_0, camera_matrix, dist_coefs)img_1 = cv2.undistort(img_1, camera_matrix, dist_coefs)
- Find the chessboard corners on both images:
pattern_size = (10, 7)res_0, corners_0 = cv2.findChessboardCorners(img_0, pattern_size)res_1, corners_1 = cv2.findChessboardCorners(img_1, ...