File Exchange

image thumbnail

Basic Three Image Stitching Code

version (2.03 KB) by Paresh Kamble
This is a basic code which tells how 3 images, displaced in X direction, can be stitched.


Updated 08 Nov 2013

View License

In this code, we have used 3 sub images which have been displaced in X-direction only. Here we have used correlation method in order to find the largest similarity between a patch of rows x 5columns dimension of second image with a series of patches of rows x 5columns dimension from the first sub image. The point giving maximum similarity is saved as index. The second image is then registered & stitched from there over the fist one. Once an image is formed from the above process, the same method is used to stitch the newly stitched image & the third image to form a final stitched image.

Cite As

Paresh Kamble (2020). Basic Three Image Stitching Code (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (11)

Fatima Hussain

Paresh Kamble

@ Joshua Cucufate, if you want to implement the same thing in Y-direction then exchanging the rows and columns should help. Though, it may also need some minor changes here and there.

Joshua Cucufate

How would I use this same code but in the Y direction?

Hazoor Ahmad

Great work. Kindly can I find the theoretical notes of this implementation for better understanding.

Chen Hong-Yu

natee ina

it work

Viraj kadam

reham elnabawy

Amir how did it work with you without telling you that there is an index out of bounds exception?


It works great.
I'm kind of new to matlab could you please advise how would you do it for a whole folder of jpgs ?


As i have been taking photos from the top of the building, this woulding work perfectly as it's only work for images that have been displaced in X-direction only. Thanks anyway and keep up the hard work!

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Image Stitching using correlation