Skip to content

Instantly share code, notes, and snippets.

@reiji1020
Created August 3, 2020 11:00
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 reiji1020/364fbb7ae0b9d8d88f99fcd9effc53eb to your computer and use it in GitHub Desktop.
Save reiji1020/364fbb7ae0b9d8d88f99fcd9effc53eb to your computer and use it in GitHub Desktop.
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/opencv_lib.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
using namespace std;
int main(void)
{
Mat frame, src_video;
char windowName[] = "enbeded gist";
namedWindow(windowName, CV_WINDOW_AUTOSIZE);
VideoCapture capture(0);
if(!capture.isOpened())
return -1;
while(waitKey(1) == -1){
do{
capture >> frame;
}while(frame.empty());
src_video = frame;
imshow(windowName,src_video);
}
destroyAllWindows();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment