Panorama Stitching — Stitch Multiple Images using OpenCV, Python & C++

Kedia Rahul
2 min readJun 9, 2021

--

Panoramic view obtained by stitching multiple images using OpenCV, Python & C++
Panoramic view obtained by stitching multiple images using OpenCV, Python & C++

Having learned the method of stitching 2 images together in the project Panorama Stitching Part 1, in this project we’ll continue with that method to stitch multiple images together to create a wide view panorama.

Approach

Knowing how to stitch 2 images together from part 1 of this project, we will use that method to stitch multiple images together. We will treat the next image to be stitched as the Secondary Image and the panoramic image formed by stitching the previous images as the Base Image. In this way, we will use the code to stitch 2 images together in a loop giving new images one by one to be stitched on the previously stitched images.

Is that all we need to do? The answer is no. As we try to increase the number of images to be stitched, we will face heavy distortion of images on the sides on giving incorrect results. Why this happens will be discussed in the respective chapter. To solve this problem, we will first project the images on the cylinder, then unroll them, and then finally stitch them together.

Another thing that we will need to correct in the previous project is the method used to overlap the images. The method used in that project is suitable for 2 images but it will break if we try to overlap more images on that.

By employing the simple steps mentioned in the above approach, we can stitch multiple images together to create a wide view panoramic image. Let’s have a look at the images being stitched one by one to create a panorama.

Images getting stitched one by one to create a panorama.

The full source code for the project can be found here:

Detailed explanation for code and logic can be found here:

OR

--

--

Kedia Rahul
Kedia Rahul

Written by Kedia Rahul

Image Processing and Computer Vision enthusiast.

No responses yet