Last active
February 14, 2020 10:26
-
-
Save hayunjong83/d5ac028309ec7d9ecff65fd1c4fbed0b to your computer and use it in GitHub Desktop.
Show live webcam by OpenCV c++.
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> | |
#include <iostream> | |
#include <stdio.h> | |
using namespace std; | |
using namespace cv; | |
int main(int argv, char** argc) | |
{ | |
Mat frame; | |
VideoCapture cap; | |
cap.open(0); | |
if(! cap.isOpendf()) | |
{ | |
cerr << "Unable to open Camera\n"; | |
return -1; | |
} | |
while(1) | |
{ | |
cap.read(frame); | |
imshow("LIVE", frame); | |
if(waitkey(1) >=0) | |
break; | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment