【发布时间】:2017-11-27 03:47:39
【问题描述】:
我正在使用 IP 摄像头和 EmguCV 来检测某个区域内的人员。
使用Highgui 捕获源,一切正常。
但是对于使用 FFMPEG 格式的 Arlo 摄像头,我无法毫无例外地获取流。
这是我尝试过的代码:
if (capture == null)
{
try
{
capture = new Capture("rtsp://<IP>:8554/live");
capture.ImageGrabbed += Capture_ImageGrabbed;
capture.Grab();
capture.Start();
}
catch (NullReferenceException exception)
{
MessageBox.Show(exception.Message);
}
catch (TypeInitializationException exc)
{
MessageBox.Show(
"Attention: You have to copy all the assemblies and native libraries from an official release of EmguCV to the directory of the demo." +
Environment.NewLine + Environment.NewLine + exc);
}
}
这里是Capture_ImageGrabbed 未触发的事件。
private void Capture_ImageGrabbed(object sender, EventArgs e)
{
Mat image = new Mat();
capture.Retrieve(image);
picCAM.Image = image.Bitmap;
}
非常感谢您的帮助!
【问题讨论】:
-
有什么异常?你得到的图像格式是一样的吗?
-
如我所说,也不例外。
-
您使用的是什么版本的 EmguCV?
-
@Reynaldi:我当时用的是EmguCV的最新版本:3.3.0