Image Stitching using OpenCV and Python (Creating Panorama Project)

7 / 23

Reading the Images

Now, let us read the images we want to stitch together to create a panorama.

Also, let us display both the left and right images side-by-side.

Note:

  • cv2.imread(<< path of the image >>) is used to read the image in the given path. It reads the given image in BGR(Blue, Green, Red) format.

  • plt.imshow displays data as an image.

  • plt.tight_layout automatically adjusts subplot params so that the subplot(s) fits in to the figure area.

INSTRUCTIONS
  • Read the right and left images using cv2.imread.

    img_right = << your code comes here >>('/cxldata/projects/uttower_right.jpg')
    
    img_left = << your code comes here >>('/cxldata/projects/uttower_left.jpg')
    
  • Display both the left and right images side-by-side using plt.imshow.

    plt.figure(figsize=(30,20))
    
    plt.subplot(1,2,1)
    plt.title("Left Image")
    plt.imshow(img_left)
    
    plt.subplot(1,2,2)
    plt.title("Right Image")
    plt.<< your code comes here >>(img_right)
    
    
    plt.tight_layout()
    
Get Hint See Answer


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...