Exemplo n.º 1
0
        private async void btStart_Click(object sender, EventArgs e)
        {
            mmLog.Clear();
            tcMain.SelectedIndex = 4;

            if (rbVideoFile.Checked)
            {
                ConfigureMediaPlayer();
            }
            else
            {
                ConfigureVideoCapture();
            }

            // add face detection
            if (cbFDEnabled.Checked)
            {
                FaceDetectionAdd();
            }

            // add car counter
            if (cbCCEnabled.Checked)
            {
                CarCounterAdd();
            }

            // add car counter
            if (cbPDEnabled.Checked)
            {
                PedestrianDetectionAdd();
            }

            //this.MediaPlayer1.Video_Effects_Enabled = true;
            //    this.MediaPlayer1.Video_Effects_Clear();
            //    this.MediaPlayer1.Video_Effects_Add(new VFVideoEffectMosaic(true, 500));

            if (rbVideoFile.Checked)
            {
                MediaPlayer1.Show();
                VideoCapture1.Hide();
                await MediaPlayer1.PlayAsync();
            }
            else
            {
                MediaPlayer1.Hide();
                VideoCapture1.Show();
                await VideoCapture1.StartAsync();
            }
        }
Exemplo n.º 2
0
        private void btStart_Click(object sender, EventArgs e)
        {
            mmLog.Clear();

            if (rbVideoFile.Checked)
            {
                ConfigureMediaPlayer();
            }
            else
            {
                ConfigureVideoCapture();
            }

            // add face detection
            if (cbFDEnabled.Checked)
            {
                FaceDetectionAdd();
            }

            // add car counter
            if (cbCCEnabled.Checked)
            {
                CarCounterAdd();
            }

            // add car counter
            if (cbPDEnabled.Checked)
            {
                PedestrianDetectionAdd();
            }

            if (rbVideoFile.Checked)
            {
                MediaPlayer1.Show();
                VideoCapture1.Hide();
                MediaPlayer1.Play();
            }
            else
            {
                MediaPlayer1.Hide();
                VideoCapture1.Show();
                VideoCapture1.Start();
            }
        }