Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Stitching images from 2 overlapping cameras stationary relative to each-other

Hi all, I'm new to CV, and trying to stitch together a video of two cameras which are stationary one relative to the other. The details:

The cameras are one beside the other and I can adjust the rotation angle between them. The cameras will be moving with respect to the world, so the scene will be changing.

The amount of frames to be stitched is roughly 300 (each frame is composed of two pictures, one from each camera).

I don't need to do the stitching in real time, but I want to do it as fast as possible using the fact that I know the relative positions of the cameras. Resolution of each picture is relatively high, around 900x600.

Right now I'm at the stage where I have code to stitch 2 single pictures, courtesy of http://ramsrigoutham.com/2012/11/22/panorama-image-stitching-in-opencv/

The main stages are:

  1. Using SURF detector to find SURF descriptor in both images
  2. matching the SURF descriptor using FLANN Matcher
  3. Postprocessing matches to find good matches
  4. Using RANSAC to estimate the Homography matrix using the matched SURF descriptors
  5. Warping the images based on the homography matrix

My question is: How can I optimize the process based on the fact that I already know the camera positions?

Ideally I would like to do some initial calculation once to find the transform between the camera perspectives, and then reuse it. But not sure with my rudimentary CV knowledge if this is indeed possible, and what transform I could use if so.

I understand that calculating the homography matrix once and reusing it won't work, since the scene is changing.

Two other possibilities:

  1. I found a similar case (but stationary scene) where the transform is computed once and reused. Which transform is this, and could it work in my case?

  2. The other possibility I found is to use the initial knowledge to find the overlapping region between two pictures, and ignore the rest of the pictures to save time. Relevant thread

Any help would be greatly appreciated!
Ron