3

I have been working on video stabilization for quite a few weeks now. The algorithm I'm following basically involves 3 steps :-

1. FAST feature detection and Matching
2. Calculating affine transformation (scale + rotation + translation x + translation y ) from matched keypoints
3. Smooth motion parameters using cubic spline or b-spline.

I have been able to calculate affine transform. But I am stuck at smoothing motion parameters. I have been unable to evaluate spline function to smooth the three parameters.

Here is a graph for smoothed data points

Here is a graph for smoothed points

Any suggestion or help as to how can I code to get a desired result as shown in the graph?

Lakshya Kejriwal
  • 1,340
  • 4
  • 17
  • 27
  • 1
    This doesn't answer you question but, if you haven't seen it, it might be of interest - [First-Person Hyperlapse Videos](https://research.microsoft.com/en-us/um/redmond/projects/hyperlapse/). – Roger Rowland Aug 20 '14 at 08:51
  • 2
    opencv does not have splines, but a [KalmanFilter](http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html#kalmanfilter) might fit as well – berak Aug 20 '14 at 09:03
  • I could use KalmanFilter but I can't compromise on time. That's why I had to opt for splines – Lakshya Kejriwal Aug 20 '14 at 09:58
  • If you have problem with splines try Gauss smoothing or any other average-type convolution -- it is well implemented in openCV. I doubt you will see a huge difference in stabilization. – Vit Nov 16 '14 at 17:17

1 Answers1

0

Here is the code that calculate the points on the curve B-spline Curves

But now the code will use all control points as transform parameters to formulate. I think i will run in post-processing (not real time).

Did you run B spline smoothing in real time?

user2745692
  • 89
  • 1
  • 9