2

I am attempting to post process a video in OpenCV. Since my camera is not fixed (must be mobile), the resulting video is very jittery due to vibrations and panning. As such, every frame that I try to look at has blurs that will make my detection less accurate if it can even detect some of the blurry images.

I've searched online and there seem to be a lot of discussion on compensating for the camera motion with gyroscopes.

Are there any cameras that will help this out? I've been using a GoPro.

Are there any algorithms that could help process the video?

I have no background in image stabilization and don't know where to start. Would appreciate any recommendations.

P3d0r
  • 1,039
  • 3
  • 12
  • 20
  • Gyroscopes are measurement devices. You need to have taken the video with a gyroscope to be able to use the data from them. I suggest you use some kind of object racking or optical flow to do it, but I have absolutely no idea of the state of the art stabilization algorithms. – Ander Biguri Feb 20 '15 at 15:32
  • http://docs.opencv.org/trunk/modules/videostab/doc/videostab.html – David Nilosek Feb 20 '15 at 16:29
  • @AnderBiguri - yes, I realize that. That's why I was acquiring about what algorithm options there are since I don't have a gyroscope to work with. I will look into optical flow, thanks! – P3d0r Feb 20 '15 at 18:44
  • Thanks David, I will start reading into those. – P3d0r Feb 20 '15 at 18:45

1 Answers1

6

Image stabilization algorithms usually works as follows:

  • Find the transformation from previous to current frame (often using optical flow for all frames). The transformation consists of some parameters such as dx (movement along the horizontal direction), dy (vertical), da (rotation angle). Basically it is a rigid Euclidean transform, with no scaling and no sharing.
  • Accumulate the transformations to get the “trajectory” for x, y, angle, at each frame.
  • Smooth out the trajectory using a sliding average window. The user defines the window radius, where the radius is the number of frames used for smoothing.
  • Create a new transformation such that new_transformation = transformation + (smoothed_trajectory – trajectory).
  • Apply the new transformation to the image sequence

Here you have two version of this idea:

Kornel
  • 5,264
  • 2
  • 21
  • 28