Created
November 5, 2014 07:38
-
-
Save dotchang/3a5250b438da055626c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/opencv.hpp> | |
using namespace std; | |
using namespace cv; | |
#ifdef _DEBUG | |
#pragma comment(lib, "E:\\opencv300\\build\\x86\\vc11\\lib\\opencv_world300d.lib") | |
#else | |
#pragma comment(lib, "E:\\opencv300\\build\\x86\\vc11\\lib\\opencv_world300.lib") | |
#endif | |
int main(int argc, char* argv[]) | |
{ | |
Mat frame; | |
namedWindow("video", 1); | |
VideoCapture cap("http://127.0.0.1:7890/ipvideo.mjpg"); | |
while ( cap.isOpened() ) | |
{ | |
cap >> frame; | |
if(frame.empty()){ | |
cout << "empty" << endl; | |
break; | |
} | |
imshow("video", frame); | |
if(waitKey(30) >= 0) break; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment