如何使用emgu cv C#创建简单的照片捕捉相机 [英] how to create for simple photo capture camera using emgu cv C#

查看:113
本文介绍了如何使用emgu cv C#创建简单的照片捕捉相机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是emgu cv c#的新手。我想创建一个摄像头,仅用于从我的笔记本电脑摄像头和连接到我的笔记本电脑的其他摄像头设备进行简单的摄像。我不希望视频捕获只有简单的照片捕获。只需一个启动和一个捕获按钮。并将保存在特定位置。请帮助我。

  public  cameracaps()
{
InitializeComponent();
}

private void Form1_Load( object sender,EventArgs e)
{
try
{

Capture cam = new Capture();

}
catch (NullReferenceException异常)
{
MessageBox.Show(exception.Message);
return ;
}
Application.Idle + = new EventHandler(processFunction);
captureprocess = 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;
}


私人 void Button1_Click(< span class =code-keyword> object
sender,EventArgs e)
{
if (captureprocess == true
{
Application.Idle- = processFunction;
captureprocess = false ;
Button1.Text = play;
}
else
{
Application.Idle + = processFunction;
captureprocess = true ;
Button1.Text = pause;


}


}



显示'Emgu的类型初始值设定项.CV.CvInvoke'抛出异常。错误..表示捕捉cam中的错误= new Capture();帮助我。

解决方案

检查这些:

相机捕捉 [ ^ ]

设置捕获设备EmguCV [ ^ ]

在C#中显示使用EmguCV捕获的网络摄像头图像 [ ^ ]


你可以从你的visualstudio参考中调用imagecaptute或stillimage参考



或下载简单.net refrence for it。

I an new in emgu cv c#. I want to create a camera only for simple photocapture from my laptop camera and other camera device connected to my laptop.I dont want video capture only simple photo capture.with one start and one capture button.and will save in particular location.please help me.

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";


    }


}


showing..The type initializer for 'Emgu.CV.CvInvoke' threw an exception. error..indicating error in Capture cam = new Capture(); help me.

解决方案

Check these:
Camera Capture[^]
Set capture device EmguCV[^]
Display webcam images captured with EmguCV in C#[^]


you can call imagecaptute or stillimage refrence from your visualstudio refrences

or download simple .net refrence for it.


这篇关于如何使用emgu cv C#创建简单的照片捕捉相机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆