/// <summary>
 /// Set the Motion Filter
 /// </summary>
 /// <param name="motionFilter">The motion filter</param>
 public void SetMotionFilter(GaussianMotionFilter motionFilter)
 {
    VideoStabInvoke.OnePassStabilizerSetMotionFilter(_ptr, motionFilter);
 }
Beispiel #2
0
 /// <summary>
 /// Set the Motion Filter
 /// </summary>
 /// <param name="motionFilter">The motion filter</param>
 public void SetMotionFilter(GaussianMotionFilter motionFilter)
 {
     VideoStabInvoke.cveOnePassStabilizerSetMotionFilter(_ptr, motionFilter);
 }
Beispiel #3
0
 public static void TestTwoPassVideoStabilizer()
 {
    ImageViewer viewer = new ImageViewer();
    using (Capture capture = new Capture("tree.avi"))
    using (GaussianMotionFilter motionFilter = new GaussianMotionFilter(15, -1.0f))
    //using (Features2D.FastDetector detector = new Features2D.FastDetector(10, true))
    //using (Features2D.SURF detector = new Features2D.SURF(500, false))
    //using (Features2D.ORBDetector detector = new Features2D.ORBDetector(500))
    using (CaptureFrameSource frameSource = new CaptureFrameSource(capture))
    using (TwoPassStabilizer stabilizer = new TwoPassStabilizer(frameSource))
    {
       Stopwatch watch = new Stopwatch();
       //stabilizer.SetMotionEstimator(motionEstimator);
       Application.Idle += delegate(object sender, EventArgs e)
       {
          watch.Reset();
          watch.Start();
          Mat frame = stabilizer.NextFrame();
          watch.Stop();
          if (watch.ElapsedMilliseconds < 200)
          {
             Thread.Sleep(200 - (int) watch.ElapsedMilliseconds);
          }
          if (frame != null)
             viewer.Image = frame;
       };
       viewer.ShowDialog();
    }
 }