# Warping wrap to the other side

**URL:** <https://forum.opencv.org/t/warping-wrap-to-the-other-side/19712>\
**Category:** C++\
**Tags:** stitching\
**Created:** [January 8, 2025, 4:35am UTC](https://forum.opencv.org/t/warping-wrap-to-the-other-side/19712 "2025-01-08T04:35:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SY-Vizzio](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@SY-Vizzio](https://forum.opencv.org/u/SY-Vizzio)\
**Post date:** [January 8, 2025, 4:35am UTC](https://forum.opencv.org/t/warping-wrap-to-the-other-side/19712/1 "2025-01-08T04:35:50Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/0/0bba7d0d69080f93a9a9411c61a493144872ca43.jpeg)  
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.

---

<div class="post-metadata">

**Author:** ![SY-Vizzio](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@SY-Vizzio](https://forum.opencv.org/u/SY-Vizzio)\
**Post date:** [January 31, 2025, 2:14am UTC](https://forum.opencv.org/t/warping-wrap-to-the-other-side/19712/3 "2025-01-31T02:14:47Z")

</div>

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!
