1
我是emgu cv的新手和主要項目我試圖從網絡攝像頭捕獲圖像並將其顯示在圖像框中,但顯示的是黑色圖像。使用Emgu捕獲圖像 - 黑色圖像
以下代碼有什麼問題?
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您使用的版本。試着運行使用網絡攝像頭的Opencv例子,如果它不起作用,它不是一個emgu問題,而是一個opencv問題。 – 2011-02-23 15:53:16
您是否嘗試過運行Emgu附帶的示例應用程序之一?如VideoSurveillance樣本。 – Mikos 2012-03-24 18:21:28