Skip to content

Instantly share code, notes, and snippets.

@jampekka
Created Oct 19, 2017
Embed
What would you like to do?
#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