OpenStitching / stitching

A Python package for fast and robust Image Stitching
Apache License 2.0
1.99k stars 156 forks source link

Stitching horizontally and vertically stacked images #71

Closed montmejat closed 1 year ago

montmejat commented 1 year ago

I'm trying to create a panorama from images looking like these:

6 7 8 0 1 2 3 5 4

However, I'm getting this error:

Traceback (most recent call last):
  File "/home/aurelien/Projects/Alteia/detection-chambres-orange/streetview/download.py", line 132, in <module>
    panorama = stitcher.stitch(image_paths)
  File "/home/aurelien/Projects/Venvs/compviz/lib/python3.10/site-packages/stitching/stitcher.py", line 94, in stitch
    cameras = self.refine_camera_parameters(features, matches, cameras)
  File "/home/aurelien/Projects/Venvs/compviz/lib/python3.10/site-packages/stitching/stitcher.py", line 147, in refine_camera_parameters
    return self.camera_adjuster.adjust(features, matches, cameras)
  File "/home/aurelien/Projects/Venvs/compviz/lib/python3.10/site-packages/stitching/camera_adjuster.py", line 49, in adjust
    raise StitchingError("Camera parameters adjusting failed.")
stitching.stitching_error.StitchingError: Camera parameters adjusting failed.

I also tried the first three images, but I'm getting this:

test

Are vertically stacked images supported?

lukasalexanderweber commented 1 year ago

can you try with --wave_correct_kind no?

montmejat commented 1 year ago

Thanks, it actually helped quite a bit. But now I'm getting something like this: pano_0_fov_70_max_180-stitcher

With OpenCV's stitcher, I'm able to get this result without touching any settings: pano_0_fov_70_max_180-cv2

OpenCV is much slower though! I'm using the code from the tutorial, I'll try to see if I can tweak the settings to get better results (great tutorial by the way)

lukasalexanderweber commented 1 year ago

Thanks for the feedback.

With OpenCV's stitcher, I'm able to get this result without touching any settings:

This is odd, since I try to be as close to the original stitching pipeline as possible... Please let me know if you have any findings

montmejat commented 1 year ago

I modified my input images to have better overlapping areas and different levels of zooms and details, which actually helped a lot. I got something pretty robust now with the standard settings.

I looked through the code and it does look similar to OpenCV :) But I really like what you've done, it's much easier to play around with than what's in OpenCV...

Thanks anyways!

lukasalexanderweber commented 1 year ago

it's much easier to play around with than what's in OpenCV...

thanks :) thats why I created this project and I love how many people seems to like the approach

Cheers