public WebCamProcessor(DashViewer viewer, float threshold) { this.threshold = threshold; setBusy(false); timer = new Timer(); timer.Interval = 100; timer.Tick += new EventHandler(timer_tick); timer.Start(); canProcess = true; this.viewer = viewer; try { webcam = new FilterInfoCollection(FilterCategory.VideoInputDevice); devices = new List <string>(); foreach (FilterInfo videoCaptureDevice in webcam) { devices.Add(videoCaptureDevice.Name); } cam = new VideoCaptureDevice(webcam[0].MonikerString); cam.NewFrame += new NewFrameEventHandler(newFrameHander); } catch (Exception ex) { File.AppendAllText("log.txt", ex.Message + Environment.NewLine); } }
public ActionExecutor(Image image, float threshold, DashViewer viewer, Processor processor) { this.image = image; this.threshold = threshold; this.viewer = viewer; this.processor = processor; }
public StreamProcessor(int timeout, DashViewer viewer, float threshold) { setBusy(false); this.timeout = timeout; this.viewer = viewer; this.threshold = threshold; streamPlayerControler = new StreamPlayerControl(); streamPlayerControler.StreamStarted += new System.EventHandler(HandleStreamStartedEvent); streamPlayerControler.StreamStopped += new System.EventHandler(HandleStreamStoppedEvent); streamPlayerControler.StreamFailed += new System.EventHandler <StreamFailedEventArgs>(HandleStreamFailedEvent); timer = new Timer(); timer.Interval = 100; timer.Tick += new EventHandler(timer_tick); }