Panorama image stitching is application of homography transformation over an image.
Conditions for homography:
- camera projection center should be rotated about its axis no translation should take place.
- There must be a sufficient amount of overlapping area to estimate correspondence.
git clone https://github.com/pareespathak/panorama.git
pip3 install -r requirements.txt
python basic_panorama.py
- Take image pairs from a calibrated camera keeping the camera location constant and perform lens distortion and rectification.
- Find keypoints in image pairs using SIFT(scale invariant feature transform).
- Find the correspondence using FLANN (Fast library for approximate nearest neighbours).
- Apply the Lowe ratio test for selecting best matches.
- Find Homography Matrix from the correspondence and extract translation information.
- Keep the first image as a reference frame and extract the transformation matrix for the second image.
- Create a resulting image which can hold both the images.
- Wrap the second image in the resulting image and add the first image to this construction.
Reference code : Panorama
![]() |
![]() |
|---|---|
| Stitching of two images: |


