Warping wrap to the other side

Hi, I’m trying to do real-time video stitching.

Currently I have an issue where my 2nd image would wrap and flip from right end to the left end. I expect it to just extend the canvas to the right instead.


Above, is the stitched image. Below is to show the matching features.
The stitched image may be a few frames behind the matching images, as they are processed in separate threads.

Unfortunately, my code is very messy and highly possible that I am unable to share much of my code. So, I will try to explain my approach.

  1. Using CUDA ORB to detect features
  2. Using CUDA BFMatcher (NORM_HAMMING) and do a knnMatch
  3. Filter the matches further with cv::findFundamentalMat
  4. Further filter with cv::findHomography
  5. Warp the 2nd image with cv::cuda::warpPerspective
  6. Copy the warped image to 1st image

Appreciate if anyone can point me to the right direction or what I am missing.

Hi microg, thanks for the reply!

I think the error in my issue is that the homographies that I got, may not be correct. I manually calculate the sampling texel position with the homographies that I received in step 4, the warping result was indeed how homographies would transform the positions to. I also noticed that when I extended the canvas width, the central of the bottom left image, is expanding vertically as the x value increase. Apologies if the explanation isn’t cleared.

Anyway, I have abandoned this approach and went on with another.

Thanks, anyway!