Skip to content

Instantly share code, notes, and snippets.

@reiji1020
Last active January 20, 2016 04:06
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/508c88899e9d98d8e115 to your computer and use it in GitHub Desktop.
Save reiji1020/508c88899e9d98d8e115 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[] = "カメラでさるくマップを撮影してね!";
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