Given 2 images (left and right in that order), stitch the image to create a panorama image.
To stitch two images
- Find the keypoints in the first and second image. In this case, I used ORB from the CV2 library.
- Find the keypoint matches between the two images and sort them by distance.
- Estimate the homography matrix using the keypoint matches.
- Using the homography matrix, project the second image in the reference frame of the first image.
- Put the first image and the projected second image side by side.
- Install UV.
- Clone this repository by running
git clone https://github.com/varun-suresh/imagestitch.py
- From the cloned repository, run
uv sync
- To run image stitch, run
uv run fastapi main.py
and navigate to localhost:8000/static/index.html
.
You should now be able to stitch images!