Last active
January 20, 2016 04:06
-
-
Save reiji1020/508c88899e9d98d8e115 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 <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