private void videoPlayer_NextFrame(VideoPlayer sender, NextFrameEventArgs args) { ProcessRegionGrowing(); }
private void videoPlayer_Opening(VideoPlayer sender, OpeningEventArgs args) { if (bgFrame != null) bgFrame.Dispose(); // create accumulator image when a new video is opened. bgAccum = new double[args.NewCapture.Height, args.NewCapture.Width]; for (int row = 0; row < args.NewCapture.Height; ++row) for (int col = 0; col < args.NewCapture.Width; ++col) bgAccum[row, col] = -1.0; bgFrame = args.NewCapture.CreateCompatibleImage(); }
private void videoPlayer_NextFrame(VideoPlayer sender, NextFrameEventArgs args) { video.Image = videoPlayer.LastFrame.ToBitmap(); ProcessMeanShift(); ProcessBackgroundSubtraction(); }