Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am,, ... I run a code example to display a USB cam on a picturebox, using version "emgucv-windows-universal-cuda 2.4.10.1940", okay, it works.
I then installed the "emgucv-windows-universal-cuda 3.0.0.2131" and here began the problems, the same code when compiled in an error, ...
"Erorr: Can not implicitly convert type'Emgu.CV.Mat'inEmgu.CV.Image <Emgu.CV.Structure.Bgr, byte>".
I'm stuck I can not fix the error ..
Help!
thank you
This is code



C#
using System;
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.Util;

namespace Camera_capture2
{
    public partial class Camera_capture2 : Form
    {
        private Capture capture;
        private bool captureInProgress;

        public Camera_capture2()
        {
            InitializeComponent();
        }

        private void ProcessFrame(object sender, EventArgs arg)
        {
            Image<Bgr, Byte> ImageFrame = capture.QueryFrame();
            CamImageBox.Image = ImageFrame;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            #region if capture is not created, create it now
            if (capture == null)
            {
                try
                {
                    capture = new Capture();
                }
                catch (NullReferenceException excpt)
                {
                    MessageBox.Show(excpt.Message);
                }
            }
            #endregion

            if (capture != null)
            {
                if (captureInProgress)
                {
                    btnStart.Text = "Start!"; //
                    Application.Idle -= ProcessFrame;
                }
                else
                {
                    btnStart.Text = "Stop";
                    Application.Idle += ProcessFrame;
                }

                captureInProgress = !captureInProgress;
            }
        }
        private void ReleaseData()
        {
            if (capture != null)
               capture.Dispose();<pre><pre></
        }
   }
}
Posted

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