public OpenCVMovie OpenMovie(string fileName) { try { VideoCapture load = new VideoCapture(fileName); OpenCVMovie original = new OpenCVMovie(load); return original; } catch { MessageBox.Show("ошибка при открытии видео"); return null; } }
private void ShowOriginal() { Opener open = new Opener(); if (filename != "") { if (openFileDialog.Filter == "jpg|*.jpg| bmp|*.bmp|png|*.png") { RefreshPictures(); } else { movie = open.OpenMovie(filename); if (movie == null) { return; } var currentFrame = movie.GetCurrentFrame().ToBitmap(); originalPictureBox.Image = currentFrame; } } }
private void OnOpenImageButtonClick(object sender, EventArgs e) { videoTimer.Stop(); openFileDialog.Filter = "jpg|*.jpg| bmp|*.bmp|png|*.png"; if (openFileDialog.ShowDialog() == DialogResult.OK) { filename = openFileDialog.FileName; this.Text = filename; } originalImage = new Opener().OpenImage(filename); filteredImage = originalImage.Copy(); ShowOriginal(); movie = null; stopPlaybackButton.Visible = false; }