Created
May 31, 2017 07:52
-
-
Save aanwark/99e2d532b9589b57ee229bee58f52aad 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 "opencv2/opencv.hpp" | |
using namespace cv; | |
int main(int argc, char** argv) | |
{ | |
VideoCapture cap; | |
// open the default camera, use something different from 0 otherwise; | |
// Check VideoCapture documentation. | |
if(!cap.open(0)) | |
return 0; | |
for(;;) | |
{ | |
Mat frame; | |
cap >> frame; | |
if( frame.empty() ) break; // end of video stream | |
imshow("this is you, smile! :)", frame); | |
if( waitKey(1) == 27 ) break; // stop capturing by pressing ESC | |
} | |
// the camera will be closed automatically upon exit | |
// cap.close(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment