public Config(UC_Camera playVideoForm, Mat img, RedLightDetector redlight)
 {
     InitializeComponent();
     formCamera           = playVideoForm;
     img2                 = new Image <Bgr, byte>(img.Bitmap);
     picConfig.Image      = img.Bitmap;
     iScale               = img2.Width / 480;
     txtXRedLight.Text    = redlight.RedPoint.X + "";
     txtYRedLight.Text    = redlight.RedPoint.Y + "";
     txtXYellowLight.Text = redlight.YellowPoint.X + "";
     txtYYellowLight.Text = redlight.YellowPoint.Y + "";
     txtXGreenLight.Text  = redlight.GreenPoint.X + "";
     txtYGreenLight.Text  = redlight.GreenPoint.Y + "";
 }
        private void btnChoose_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofdVideo = new OpenFileDialog();

            ofdVideo.InitialDirectory = @"E:\g\Media";
            ofdVideo.Filter           = "All files(*.*)|*.*|mp4 files(*.mp4)|*.mp4|All files (*.avi)|*.avi";
            ofdVideo.FilterIndex      = 1;
            ofdVideo.Multiselect      = true;
            ofdVideo.RestoreDirectory = true;

            if (ofdVideo.ShowDialog() == DialogResult.OK)
            {
                _capture = new Capture(ofdVideo.FileName);
                //fps = (int)_capture.GetCaptureProperty(CapProp.Fps);
                fps           = 40;
                textBox1.Text = ofdVideo.FileName;
                redlight      = new RedLightDetector();
            }
        }