Пример #1
0
        private void Load(bool WebCam = false)
        {
            if (!WebCam)
            {
                var OFD = new OpenFileDialog();

                var result = OFD.ShowDialog();

                if (result == DialogResult.OK)
                {
                    Detector = new MotionDetector(OFD.FileName, WebCam);
                }
            }
            else
            {
                Detector = new MotionDetector(null, true);
            }
            //Subscribe
            if (!FPS_cb.Checked)
            {
                Detector.Sub(ImageBoxUbdater);
            }

            Play_button.Visible  = true;
            Pause_button.Visible = true;

            if (!WebCam)
            {
                Timer.Interval = Detector.GetFrameRate();
            }
        }
Пример #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            tmpI = 0;
            VideoCaptureDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            Detector1           = new MotionDetector(new TwoFramesDifferenceDetector(), new GridMotionAreaProcessing());
            Detector2           = new MotionDetector(new TwoFramesDifferenceDetector(), new MotionAreaHighlighting());
            Detector3           = new MotionDetector(new TwoFramesDifferenceDetector(), new MotionBorderHighlighting());
            detectionLvl        = 0;


            foreach (FilterInfo VideoCaptureDevice in VideoCaptureDevices)
            {
                comboBox1.Items.Add(VideoCaptureDevice.Name);
            }

            comboBox1.SelectedIndex = 0;
            radioButton1.Checked    = true;
            FinalVideo = new VideoCaptureDevice();
            timer1.Start();
        }