Improving OpenCV performance when stitching 360° mosaics
Hi,
I am trying to compose a 360° mosaic using OpenCV. However, I am hitting a major performance issue due to the following.
During the warping process of all my images, due to the 360° nature of the stitching, some images are bound to be "cut" in two parts, like this:
As a result, OpenCV registers this image as being a 1806x365 image after warping, which means that during most following steps (especially seam finding), the performance is drastically decreased. Indeed, when finding overlapping images, this particular image is overlapping with every other image since it is now sizing the entire canvas size.
Ideally I would love to find a way to stitch as if the picture were not wrapped on both sides of the screen:
Anyone has any experience doing this?
Thanks!
Edit: I realized it's not clear why this image has to be cut in half. The picture is part of a full 360 panorama, as it can be shown here
If I remove the 16th image, it takes only 4 seconds to stitch the full panorama. Adding that 16th image adds a whole 20 seconds to the process, simply because the algorithm is trying to find overlaps between this 16th image and all 15 others.
I don't understand why this image had to be cut in half and not used as a whole.
Hey sorry for the delay on the answer. It has to because i'm basically stitching 16 photos together to recreate a full panorama. This one happens to be the one that falls on the edge of the full canvas.
This: https://i.imgur.com/BFyTfjf.png Is the final panorama
But why can't it just be pasted as a whole on the leftmost or rightmost part of the panorama? The center of 360 panorama is arbitrary.
Well, this is the bottom of my question: I am using the high level stitching API from OpenCV and this seems to be the default behaviour. Is there an option I missed? In the process, the spherical warper warps each image, and I can't find out how to avoid this from happening. Thanks!
Edit: Oh yeah btw, I'm using the spherical warper instead of the cylindrical warper because the end goal is to have a full 360x180 :)