2014-01-14 64 views
0

我IPCAM的IP http://admin:@192.168.1.124:80/
谁可以教我如何使用opencv2.4.3写的真正程序连接到IPCAM 我希望能给我完整的程序来引用 非常感谢很多捕捉画面

+0

非常感谢你和我完成它 – itrobot2013

回答

0

相机基本样板,无论什么输入:


#include "opencv2/highgui/highgui.hpp" 
#include "opencv2/core/core.hpp" 

using namespace cv; 

int main() 
{ 
    VideoCapture cap("http://admin:@192.168.1.124:80/"); // connect to an ip-cam (might need some additional dummy param like: '?type=mjpeg' at the end 
    //VideoCapture cap("/home/me/some.avi"); // load a video file 
    //VideoCapture cap(-1); // get the 1st 'local' usb webcam 
    while(cap.isOpened()) 
    { 
     Mat frame; 
     if (! cap.read(frame)) 
      break; 

     // 
     // your processing here 
     // 

     imshow("lalala",frame); 
     int k = waitKey(10); 
     if (k==27) 
      break; 
    } 
    return 0; 
}