/// <summary> /// Set the Motion Filter /// </summary> /// <param name="motionFilter">The motion filter</param> public void SetMotionFilter(GaussianMotionFilter motionFilter) { VideoStabInvoke.OnePassStabilizerSetMotionFilter(_ptr, motionFilter); }
/// <summary> /// Set the Motion Filter /// </summary> /// <param name="motionFilter">The motion filter</param> public void SetMotionFilter(GaussianMotionFilter motionFilter) { VideoStabInvoke.cveOnePassStabilizerSetMotionFilter(_ptr, motionFilter); }
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(); } }