Skip to content

Instantly share code, notes, and snippets.

@jampekka
Created October 19, 2017 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jampekka/a2bacb0a75c3f23f7d9af92f2984c66a to your computer and use it in GitHub Desktop.
Save jampekka/a2bacb0a75c3f23f7d9af92f2984c66a to your computer and use it in GitHub Desktop.
#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