Привет, когда я запускаю этот код на С# с помощью emgucv, чтобы увидеть живую ip-камеру в окне изображения, он показывает мне ошибку в этой части:
Mat frame = new Mat();
_capture.Retrieve(frame, 0);
captureImageBox.Image = frame;
ошибка упоминает
Невозможно преобразовать тип emgu.cv.mat в emgu.cv.imag...
Какие строки кода мне нужно изменить, чтобы запустить его правильно....
Характеристики
- Visual Studio 2015
эмгуцв v3.1 x64
public partial class Form1 : Form { private Capture _capture = null; private bool _captureInProgress; public Form1() { InitializeComponent(); CvInvoke.UseOpenCL = false; try { _capture = new Capture("https://webcam.st-malo.com/axis-cgi/mjpg/video.cgi?"); _capture.ImageGrabbed += ProcessFrame; } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message); } } private void ProcessFrame(object sender, EventArgs arg) { Mat frame = new Mat(); _capture.Retrieve(frame, 0); captureImageBox.Image = frame; } private void captureButton_Click(object sender, EventArgs e) { if (_capture != null) { if (_captureInProgress) { //stop the capture captureButton.Text = "Start Capture"; _capture.Pause(); } else { //start the capture captureButton.Text = "Stop"; _capture.Start(); } _captureInProgress = !_captureInProgress; } }
}