Sequential image stitching

asked 2015-02-10 09:12:36 -0500

Ribs gravatar image

Hi, I've tried to do this: Loop: stitched + frame2 = stitched.

It keeps stitching the images from the left to right, creating a panorama. But the left side of the image is getting blurred. Any ideas why? I'm just using the Stitch function.

Is there any better algorithm to stitch those sequential images?

Thank you!

edit retag flag offensive close merge delete

Comments

1

I think that is how the stitch function works. In order to stitch the images, the one on the left loses resolution. Thus since your sequence is stitched in a loop, the blur at each step keeps increasing.

There is a way to manually stitch images. You need to calculate the homography matrix between the two images and then based on that use the warpPerspective function to stitch the images. However, I am not sure that this would solve your blur problem. Take a look at this tutorial. It might be useful -> ramsrigoutham.com/2012/11/22/panorama-image-stitching-in-opencv/

Potato gravatar imagePotato ( 2015-02-10 09:49:04 -0500 )edit

Person with a difficult name: I used the simple stitch example and added this loop.
Potato: Thank you, I'll try that!

Ribs gravatar imageRibs ( 2015-02-10 10:05:15 -0500 )edit

This tutorial didn't even stitch my images =( I'll try to change some parameters

Ribs gravatar imageRibs ( 2015-02-10 11:29:41 -0500 )edit

Like being said it is to reduce noise to yield keypoints. I guess you will need to use masks to reduce this effect. Basically you take the left 10% of image one and the right 10% of image two and only merge based on those regions. This will reduce the blurring effect you are experiencing.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-02-11 04:38:12 -0500 )edit

yea, I thought about that, because resolution is very important to my application. Do you think it works by using this function below and use the R.O.I. for the 10% of the image?

C++: Status Stitcher::stitch(InputArray images, const std::vector<std::vector<Rect>>& rois, OutputArray pano)
Parameters: 
images – Input images.
rois – Region of interest rectangles.
pano – Final pano.
Ribs gravatar imageRibs ( 2015-02-11 04:56:31 -0500 )edit

Yeah that should do the trick!

StevenPuttemans gravatar imageStevenPuttemans ( 2015-02-11 05:42:15 -0500 )edit

how do I specify this ROI? I'm struggling at it.

    Rect left = cvRect(0, 0, imgs[i].cols*0.2, imgs[i].rows);
    vector<Rect> vLeft;
    vLeft.push_back(left);
    roiStitch.push_back(vLeft);
    //right rect
    Rect right = cvRect(imgs[i].cols*0.2, 0, imgs[i].cols*0.2, imgs[i].rows);
    vector<Rect> vRight;
    vRight.push_back(right);
    roiStitch.push_back(vRight);

I'm creating rectangles of the size I want. Cool. But, how does the stitch function knows that the rectangle of that size goes on the right and left sides of the image?

Ribs gravatar imageRibs ( 2015-02-11 07:17:52 -0500 )edit

I am sorry but I have no programming experience with the stitcher pipeline. Should wait for someone else.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-02-11 07:44:58 -0500 )edit

ok thanks, but the issue is only to create a ROI of the type "vector<vector <rect=""> >& rois".

Ribs gravatar imageRibs ( 2015-02-11 08:13:01 -0500 )edit