GithubHelp home page GithubHelp logo

avinash793 / panoramic-image-stitching Goto Github PK

View Code? Open in Web Editor NEW
190.0 4.0 59.0 12.44 MB

Create panorama image using invariant features from given set of overlapping images.

License: MIT License

Python 100.00%
invariants-features image-stitching feature-detection opencv3-python ransac panoramic-camera homography image-manipulation consecutive-images sift

panoramic-image-stitching's Introduction

Panoramic Image Stitching

Create panorama image from given set of overlapping images.

Requirements

  • numpy >= 1.24.3
  • opencv-python >= 4.9.0 (latest as of 2024)
  • opencv-contrib-python >= 4.9.0 (latest as of 2024)
  • imutils >= 0.5.4

Description

We have implemented the panoramic image stitching algorithm using invariant features from scratch. We have Implemented the David Lowe research paper on "Panoramic Image Stitching using Invariant Features". Used SIFT to detect features, RANSAC, Homography and Warp Prespective concepts.

About Data

NOTE: You can experiment with any images (of your own choice). We have experimented with many which you can find in data/ folder. Please check the results below.

Sample Images

  • Repo already provides sample images present in data/ folder. Copy images from data/ folder and put it into inputs/ folder.
  • Default: you will find data/tajm folder images in inputs/ folder.

Custom Images

You can create your own images as well and put it into inputs/ folder.

  • Make sure your images must be in sequence and have overlapping parts between consecutive images.
  • Minimum width and height for all images should be 400.

How To Run

  1. Put images in inputs/ folder from which you want to create panorama image.
  2. Run:
    python3 stitch.py
  3. Enter the number of images you want to concatenate (i.e number of images present in inputs/ folder):
    Enter the number of images you want to concatenate: 4
  4. Keep entering the images name along with path and extension. For Ex:
    Enter the image names with extension in order of left to right in the way you want to concatenate: 
    Enter the 1 image name along with path and extension: inputs/tajm1.jpg
    Enter the 2 image name along with path and extension: inputs/tajm2.jpg
    Enter the 3 image name along with path and extension: inputs/tajm3.jpg
    Enter the 4 image name along with path and extension: inputs/tajm4.jpg
  5. panorama_image.jpg and matched_points.jpg will be created in output/ folder.

RESULTS

Result of Images from data/tajm folder

tajm1.jpg, tajm2.jpg, tajm3.jpg, tajm4.jpg

alt text

Result of Images from data/nature folder

nature1.jpg, nature2.jpg, nature3.jpg, nature4.jpg, nature5.jpg, nature6.jpg

alt text

Result of Images from data/my folder

my1.jpg and my2.jpg

alt text

Result of Images from data/taj folder

taj1.jpg and taj2.jpg

alt text

Result of Images from data/room folder

room1.jpg and room2.jpg

alt text

panoramic-image-stitching's People

Contributors

avinash793 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

panoramic-image-stitching's Issues

image resizing

in stitch.py you have resized images to size 400. why this number and how can I know the real number for my application?
by default size(400) Panorama_image is sometimes corrupted.

detect-feature_and_keypoints issue, cv2 function not recognized

Hello !
I'd like to use your code for your program but i got an error message telling me this :

Traceback (most recent call last):
File "C:\Users\thfaure\Desktop\Scripts_python\Panorama_avinashk442\stitch.py", line 35, in
(result, matched_points) = panaroma.image_stitch([images[no_of_images-2], images[no_of_images-1]], match_status=True)
File "C:\Users\thfaure\Desktop\Scripts_python\Panorama_avinashk442\panorama.py", line 11, in image_stitch
(KeypointsA, features_of_A) = self.Detect_Feature_And_KeyPoints(imageA)
File "C:\Users\thfaure\Desktop\Scripts_python\Panorama_avinashk442\panorama.py", line 43, in Detect_Feature_And_KeyPoints
descriptors = cv2.xfeatures2d.SIFT_create()
AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'

For the record i'm using python 3.9 and cv2 is on 4.5.1 version.
It seems like the xfeatures2d is no longer a part of the opencv library !
I got the same error message for 2 and more numerous set of multiple images.
Any clue ?

how to stitch multiple images

i checked your code it was working awesome.
could you please help me out for how to check 200 images without loss data.
if you want i will ready to send you the images

I am encountering this error. Kindly help me out.

Traceback (most recent call last):
File "C:/Users/user/PycharmProjects/Panoramic-Image-Stitching-using-invariant-features-master/panorama.py", line 2, in
import imutils
File "C:\Users\user\PycharmProjects\untitled\venv\lib\site-packages\imutils_init_.py", line 8, in
from .convenience import translate
File "C:\Users\user\PycharmProjects\untitled\venv\lib\site-packages\imutils\convenience.py", line 6, in
import cv2
ModuleNotFoundError: No module named 'cv2'

Process finished with exit code 1

Stitching failed for images from overhead camera.

Hey, thanks for the wonderful repo but it failed for over head images.
I tried using your repo for images captured from a rotating PTZ Camera and the output result show only the images appended to each other.
FYI, Check below attached output and input images, any feedback or advice is really appreciated.
frame_8
frame_9
frame_10
frame_11
panorama_image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.