import cv2 import numpy as np def drawMatchesKnn_cv2(img1_gray,kp1,img2_gray,kp2,goodMatch): h1, w1 = img1_gray.shape[:2] h2, w2 = img2_gray.shape[:2] vis = np.zeros((max(h1, h2), w1 + w2, 3), np.uint8) vis[:h1, :w1] = img1_gray vis[:h2, w1:w1 + w2]…