簡體   English   中英

我如何使用emgucv從IP攝像機捕獲視頻

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

請有人可以在其他帖子中的C#Visual Studio中使用emgucv訪問IP攝像機

捕獲=新的Emgu.CV.CvInvoke.cvCreateFileCapture(“ Ul ip camera”);

當我運行代碼時,說“在CvInvoke中不存在tipe cvCreateFileCapture”

有人知道其他形式可以使用emgucv訪問網絡攝像機,但是可以工作...謝謝!

這是我的作品,與我合作,我使用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