Created
October 19, 2017 15:09
-
-
Save jampekka/a2bacb0a75c3f23f7d9af92f2984c66a to your computer and use it in GitHub Desktop.
This file contains 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> | |
#include <string> | |
using namespace cv; | |
int main(int argc, char **argv) { | |
int camno = 0; | |
if(argc > 2) { | |
camno = std::atoi(argv[1]); | |
} | |
VideoCapture cap(camno); | |
if(!cap.isOpened()) { | |
return -1; | |
} | |
Mat frame; | |
while(true) { | |
cap >> frame; | |
imshow("frame", frame); | |
waitKey(1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment