1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#include <opencv2\core\core.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main ()
{
string adr = "http://10.10.3.16/videostream.cgi?user=etd&pw=12345";
string winMain = "Principale";
Mat frame;
VideoCapture cap(adr);
if (!cap.isOpened()){
string k;
cout << "Impossible d'ouvrir la source!\r\n";
cin >> k;
return -1;
}
int c = 0;
namedWindow(winMain);
while (c != 27)
{
if (!cap.read(frame))
{
cout << "Aucune image!\r\n";
c = waitKey();
}
imshow(winMain, frame);
c = waitKey(33);
}
} |