我是 emgu cv c# 的新手。我想创建一个仅用于从我的笔记本电脑相机和连接到我的笔记本电脑的其他相机设备进行简单照片捕捉的相机。我不希望视频捕捉只简单的照片捕捉。一个开始和一个捕捉按钮。并将保存在特定位置。帮助会可观。
namespace camera
{
public partial class cameracaps : Form
{
Capture capturecam=null;
bool capturingprocess=false;
Image<Bgr,Byte>imgOrg;
Image<Gray,Byte>imgproc;
public cameracaps()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
try
{
Capture cam = new Capture();
}
catch (NullReferenceException exception)
{
MessageBox.Show(exception.Message);
return;
}
Application.Idle += new EventHandler(processFunction);
capturingprocess=true;
}
void processFunction(object sender,EventArgs e)
{
imgOrg=capturecam.QueryFrame();
if(imgOrg ==null)return;
imgproc=imgOrg.InRange(new Bgr(50,50,50),new Bgr(250,250,250));
imgproc = imgproc.SmoothGaussian(9);
original.Image=imgOrg;
processed.Image=imgproc;
}
private void Button1_Click(object sender, EventArgs e)
{
if(capturingprocess==true)
{
Application.Idle-=processFunction;
capturingprocess = false;
Button1.Text="play";
}
else
{
Application.Idle+= processFunction;
capturingprocess= true;
Button1.Text="pause";
}
}
}
}
显示..“Emgu.CV.CvInvoke”的类型初始化程序引发了异常。错误..指示错误
Capture cam = new Capture();
帮助我。