用Emgu捕获图像-黑色图像 [英] Capturing an image with Emgu - black image
本文介绍了用Emgu捕获图像-黑色图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是emgu cv的新手,对于一个大型项目,我试图从网络摄像头捕获图像并将其显示在图像框中,但显示的是黑色图像。
I'm a newbie in emgu cv and for a major project I'm trying to capture an image from a webcam and show it in an image box, but it's showing a black image.
以下代码有什么问题?
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捕获。
In my case Kaspersky AntiVirus was blocking the access to my webcam. After changing some security settings I was able to get emgu capture back working.
这篇关于用Emgu捕获图像-黑色图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文