You need to complete the following steps:
- Import the necessary modules:
import cv2import numpy as np
- Load the images we're going to combine into a panorama:
images = []images.append(cv2.imread('../data/panorama/0.jpg', cv2.IMREAD_COLOR))images.append(cv2.imread('../data/panorama/1.jpg', cv2.IMREAD_COLOR))
- Create a panorama stitcher, pass your images to it, and parse the result:
stitcher = cv2.createStitcher()ret, pano = stitcher.stitch(images)if ret == cv2.STITCHER_OK: cv2.imshow('panorama', pano) cv2.waitKey() cv2.destroyAllWindows()else: print('Error during stiching')