简体   繁体   English

我如何使用emgucv从IP摄像机捕获视频

[英]How I capture video from an IP camera using emgucv

Please someone can access to a ip camera with emgucv in c# visual studio in other post share the code 请有人可以在其他帖子中的C#Visual Studio中使用emgucv访问IP摄像机

capture = new Emgu.CV.CvInvoke.cvCreateFileCapture("Url ip camera"); 捕获=新的Emgu.CV.CvInvoke.cvCreateFileCapture(“ Ul ip camera”);

when i run the code say"the tipe cvCreateFileCapture does not exist in CvInvoke" 当我运行代码时,说“在CvInvoke中不存在tipe cvCreateFileCapture”

someone know other form to access an ip camera with emgucv but working...thanks! 有人知道其他形式可以使用emgucv访问网络摄像机,但是可以工作...谢谢!

this is my exmaple, it works with me, I a using EmguCV V3 这是我的作品,与我合作,我使用EmguCV V3

public partial class Form1 : Form
{
    private Capture _capture = null;
    private bool _captureInProgress;
    public Form1()
    {
        InitializeComponent();
        CvInvoke.UseOpenCL = false;
        try
        {
            _capture = new Capture("http://webcam.st-malo.com/axis-cgi/mjpg/video.cgi?");//
            _capture.ImageGrabbed += ProcessFrame;
        }
        catch (NullReferenceException excpt)
        {
            MessageBox.Show(excpt.Message);
        }
    }

    private void ProcessFrame(object sender, EventArgs arg)
    {
        Mat frame = new Mat();
        _capture.Retrieve(frame, 0);

        captureImageBox.Image = frame;

    }

    private void captureButton_Click(object sender, EventArgs e)
    {
        if (_capture != null)
        {
            if (_captureInProgress)
            {  //stop the capture
                captureButton.Text = "Start Capture";
                _capture.Pause();
            }
            else
            {
                //start the capture
                captureButton.Text = "Stop";
                _capture.Start();
            }

            _captureInProgress = !_captureInProgress;
        }
    }
}

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM