【发布时间】:2019-01-23 16:03:57
【问题描述】:
我是 emgu cv 的新手,对于一个大型项目,我正在尝试从网络摄像头捕获图像并将其显示在图像框中,但它显示的是黑色图像。
以下代码有什么问题?
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.CV.UI;
using Emgu.Util;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
private Capture capture;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
if (capture == null)
capture = new Capture();
Image<Bgr,Byte> img=capture.QueryFrame();
imageBox1.Image = img;
}
}
}
【问题讨论】:
-
你应该提供更多关于你的网络摄像头的信息,如果它是内置的笔记本电脑,以及你使用的是哪个 emgu 版本。 Howewer 尝试运行使用网络摄像头的 Opencv 示例,如果它不起作用,这不是 emgu 问题,而是 opencv 问题。
-
您是否尝试过运行 Emgu 附带的示例应用程序之一?例如 VideoSurveillance 示例。