Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
C#
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.
Posted
Updated 9-Oct-13 3:05am
v2

 
Share this answer
 
you can call imagecaptute or stillimage refrence from your visualstudio refrences

or download simple .net refrence for it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900