Final Result |
Left Part of the Image (Gondor from LOTR) |
Right Part of the Image (Rohan from LOTR) |
Calculated Stitch Path |
Stitched Image Before Filters |
I want to share an algorithm: "Stitching Images with Calculation of Squared Difference of the Pixels." Briefly, the methodology calculates the smallest squared difference of the overlapped pixels in grayscale and creates a path in the way you choose. I used Minas Tirith (Gondor Castle) and Rohan images to test my algorithm which is written in Python and OpenCV. The second and third images represent the original images from the Lord of the Rings movies. The fourth one depicts the calculated seam path by the algorithm in grayscale and the last image is the result in an RGB color map. I added median blur to decrease the sharp-cutting places of the images to the final result and show it in grayscale (first image). In the end, we have a perfect image that Gandalf riding his Shadowfax between two mankind towns in Middle Earth.
* Python3
* OpenCV
* Jupyter Notebook or any suitable integrated development environment (IDE)
- Download Stitching.py file
- Use your own images and change the image path in the code
- Try other overlapping sizes to observe changes in your combined image.
Please share your comments and ideas about the project with me. Thank you for your time.