public void GetRuntime() { Dictionary<string, object> d = new Dictionary<string, object>(); d["runtime"] = new Base.Runtime(); Assert.DoesNotThrow(new TestDelegate(() => d.GetRuntime())); }
public void Execute(Dictionary<string, object> b) { while (_hc == null) { bool query_result = b.GetInteractor().Query("Please specify a correct cascade file", this); bool should_cancel = b.GetRuntime().StopRequested; if (!query_result || should_cancel) { b.GetRuntime().RequestStop(); return; } } Image<Bgr, byte> i = b.GetImage("source"); Image<Gray, byte> gray = i.Convert<Gray, byte>(); foreach(MCvAvgComp comp in gray.DetectHaarCascade(_hc)[0]) { i.Draw(comp.rect, new Bgr(Color.Red), 4); } }
public void Execute(Dictionary<string, object> bundle) { // If you have a long running operation, make sure // to stay responsive cancellation events. while (true) { // Test if a stop request is pending if (bundle.GetRuntime().StopRequested) { return; } System.Threading.Thread.Sleep(50); } }
/// <summary> /// Execute the video filter. /// </summary> /// <remarks>If looping of the video is disabled, this filter will /// request a stop of the runtime once it has completed producing /// all frames of the video.</remarks> /// <param name="b">Bundle of information</param> public override void Execute(Dictionary<string, object> b) { Image<Bgr, byte> i = this.Frame(); b[this.Name] = i; if (i == null) { b.GetRuntime().RequestStop(); } }
// Execute filter public void Execute(Dictionary<string, object> bundle) { System.Console.WriteLine("Hello World!"); bundle.GetRuntime().RequestStop(); }
public void Execute(Dictionary<string, object> b) { b["result"] = 14.0; b.GetRuntime().RequestStop(); }
public void Execute(Dictionary<string, object> bundle) { _logger.Info("Hello World!"); bundle.GetRuntime().RequestStop(); }