【发布时间】:2018-04-24 01:42:30
【问题描述】:
我正在测试 EMGU 的学校作业,我正在关注 this 教程以基本了解 EMGU 的工作方式,但我遇到了问题。
这是我的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
using Emgu.CV.UI;
namespace FacialRecognition
{
public partial class Form1 :Form
{
private Capture _capture;
bool CapturingProcess = false;
Image<Bgr, Byte> imgOrg;
Image<Gray, Byte> imgProc;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
try {
_capture = new Capture(CaptureType.DShow);
} catch(NullReferenceException ex) {
MessageBox.Show(ex.Message);
return;
}
}
void processFunction(object sender, EventArgs e)
{
imgOrg = _capture.QueryFrame();
if(imgOrg == null) return;
imgProc = imgOrg.InRange(new Bgr(50, 50, 50), new Bgr(255, 255, 255));
imgProc = imgProc.SmoothGaussian(9);
original.Image = imgOrg;
processed.Image = imgProc;
}
}
}
但是,我得到了错误:
The type or namespace name 'Capture' could not be found (are you missing a using directive or an assembly reference?)
它提示using System.Text.RegularExpressions;,这很奇怪。
我猜我遗漏了一些东西,但我引用了所有 DLL 在教程中。以下是一些截图:
Solution Explorer(设置为Copy always)
References(Emgu.CV.World.NetStandard1_4.dll 和 Emgu.CV.World.dll 发生冲突)
【问题讨论】:
-
有解决方案吗?
标签: c# visual-studio emgucv