1 | initial version |
int main()
{
VideoCapture cap("http://213.157.112.12:8082/mjpg/video.mjpg?resolution=352x288");
Mat frame;
namedWindow("video", 1);
while(cap.isOpened()) {
cap >> frame;
if(!frame.data) break;
//
// now you can process process the frame data
//
imshow("video", frame);
if(waitKey(30) >= 0) break;
}
return 0;
}
2 | No.2 Revision |
#include "opencv/cv.h"
#include "opencv/highgui.h"
using namespace cv;
int main()
{
VideoCapture cap("http://213.157.112.12:8082/mjpg/video.mjpg?resolution=352x288");
Mat frame;
namedWindow("video", 1);
while(cap.isOpened()) {
cap >> frame;
if(!frame.data) break;
//
// now you can process process the frame data
//
imshow("video", frame);
if(waitKey(30) >= 0) break;
}
return 0;
}