Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Get position of source points in destination after stitching

Hi all,

I have some region of interest in my source images which I would like to visualise in the final panorama after stitching.

I have tried drawing them on the source images before stitching but they can get covered in the overlap between images and disappear.

So, I tried to warp the points using the warpPoint function so that I could re-draw these ROIs on the final image.

Basically, I am going through the stitch detailed example and trying to warp the points before the images are warped in the example :

    cameras[img_idx].K().convertTo(K, CV_32F);
    p1Warp = warper->warpPoint(p1, K, cameras[img_idx].R);
    p2Warp = warper->warpPoint(p2, K, cameras[img_idx].R);
    cout << "p1 warp: " << p1Warp << " p2 warp: " << p2Warp << "\n";
    // Warp the current image

    warper->warp(img, K, cameras[img_idx].R, INTER_LINEAR, BORDER_REFLECT, img_warped);

This also does not seem to work as I am getting negative coordinates for my points.

TLDR: How to find position of a region of interest in the destination image after stitching?

Thanks!

Get position of source points in destination after stitching

Hi all,

I have some region of interest in my source images which I would like to visualise in the final panorama after stitching.

I have tried drawing them on the source images before stitching but they can get covered in the overlap between images and disappear.

So, I tried to warp the points using the warpPoint function so that I could re-draw these ROIs on the final image.

Basically, I am going through the stitch detailed example and trying to warp the points before the images are warped in the example :

    cameras[img_idx].K().convertTo(K, CV_32F);
    p1Warp = warper->warpPoint(p1, K, cameras[img_idx].R);
    p2Warp = warper->warpPoint(p2, K, cameras[img_idx].R);
    cout << "p1 warp: " << p1Warp << " p2 warp: " << p2Warp << "\n";
    // Warp the current image

    warper->warp(img, K, cameras[img_idx].R, INTER_LINEAR, BORDER_REFLECT, img_warped);

This also does not seem to work as I am getting negative coordinates for my points.

TLDR: How to find position of a region of interest in the destination image after stitching?

Thanks!