Video Stabilization with spin product OpenCV

I’m trying to stabilize video using OpenCV, but my video is a walkaround 360 spin like this spin, but the stabilize not perfect has a shaking because the optical flow not working perfectly with the spined video

can you find python code here

Hi @Ahmad_Al_Masri

I have no experience with stabilization, by I think that posting your video may help people to understand the problem.

Hello @Alejandro_Silvestri

Thank you for your reply

original video

stabilized video

the stabilized video not smoother have a frames shaked

your result is almost as good as you CAN possibly expect.

you are using only affine transformations. a proper stabilization requires perspective transformations. that’s why you see some wobbling near the corners of the video frame.

purely visual/optical stabilization can be noisy. “action cameras” use gyroscope sensor data additionally.

ordinary stabilization can remove motion in the camera’s angle but it can’t remove/smooth motion in the camera’s position. that is why you see a “parallax” effect… you’re moving around the object, so the horizontal parallax is desired, but vertical parallax would not be… but because your camera is handheld and not physically stabilized, you’ll get that too.

you might have seen some “Hyperlapse” from Microsoft Research. that partly reconstructs the scene. that’s advanced stuff and you’d need a graduate level understanding of computer vision to get that working.

if you want anything approaching a turntable view (as you posted first), you will need some scene reconstruction. otherwise the vertical and radial (inwards/outwards) motion of the camera will STILL be visible.

even with scene reconstruction (“structure from motion”), you can expect to see artefacts in the result.

it’s probably cheaper and quicker to put a camera on a circular dolly track.


@crackwitz Thank you, I’m trying to minimize zoom speed for stabilization of all frames shaken, frames Shaken in stabilized video result it’s zoomed in out, do you have any idea to make zoom effect smoother

I am trying to calculate amount of stability of video ,how can I do this?