Video to panorama image

3.1k Views Asked by At

Kind of new in opencv or any other framework , I have a video from a static camera I would like to create a panorama image out of. I did try splitting the video into frames and then stitching all the frames together but it was too slow. Is there any other solutions ?

2

There are 2 best solutions below

1
On

There is no out-of-the-box solution in OpenCV.

To speed it up, you could take only every n-th frame and hope that the camera man doesn't move too fast.

You might try to dive deeper into the stitching pieline. I don't know about your video, but you could do the following:

If your video often has parts with a still camera try to check if there is movement. If there is no movement you don't habe to stitch. To detect the movement fast take a scaled down version of the frames, or only a region of your frames and match these.

If you know the direction of movement you could try and cut a part of your image of. So if the camera is moving to the right you could cut the leftmost part of and still stitch, because the change in videoinformation from frame to frame should be small.

tl;dr no easy way, dive deeper into the stitching pipeline and tailor the algorithm to your source material to gain a speed-up

0
On

You can split your video into small images by interpolating the frames down using resize() function, and once you have a stitched total image you can interpolate it up by the same ratio.

resize(input /* input image*/, result /*result image */, result.size()/*new dimensions*/, 0, 0, INTER_CUBIC/* interpolation method*/);

To know more interpolation methods, you can check this doc http://docs.opencv.org/modules/imgproc/doc/geometric_transformations.html#resize

Even you can define an area of your images to detect the corresponding keypoints