Improving OpenCV performance when stitching 360° mosaics

asked 2017-07-13 08:34:51 -0600

Bibzball gravatar image

updated 2017-07-17 09:30:59 -0600

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:

Wrapping Image

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:

Non wrapping image

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

Full Panorama

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.

edit retag flag offensive close merge delete

Comments

I don't understand why this image had to be cut in half and not used as a whole.

KjMag gravatar imageKjMag ( 2017-07-13 11:11:23 -0600 )edit

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

Bibzball gravatar imageBibzball ( 2017-07-17 09:24:53 -0600 )edit

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.

KjMag gravatar imageKjMag ( 2017-07-17 11:32:48 -0600 )edit

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 :)

Bibzball gravatar imageBibzball ( 2017-07-17 12:20:56 -0600 )edit