2016-07-30 57 views
0

請人可以訪問到網絡攝像機emgucv在C#中的Visual Studio中的其他職務份額的代碼使用emgucv

捕獲=新Emgu.CV.CvInvoke.cvCreateFileCapture(「URL如何捕捉來自IP攝像機的視頻ip camera「);

當我運行的代碼說「TIPE cvCreateFileCapture不存在CvInvoke」

有人知道其它形式與emgucv但工作...感謝訪問的IP攝像頭!

回答

1

這是我〔實施例,它與我,我一個使用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; 
     } 
    } 
} 

enter image description here

+0

thaks了很多我在C#中,你可以分享你的所有項目對這個新是非常importnat對我來說....謝謝你,你正在使用vs2010或vs2015 –