#include <iostream>
#include "opencv2\opencv.hpp"
using namespace cv;
using namespace std;
int main(void)
{
VideoCapture capture;
Mat frame;
capture.open(0);
if(! capture.isOpened())
{
cout << "Not Open" << endl;
waitKey(10000);
return 1;
}
namedWindow("Original Camera");
cout<<"<ESC> - quit the program"<<endl;
for(;;)
{
capture >> frame;
if( (waitKey(33) & 255) == 27 )
{
capture.release();
break;
}
imshow("Original Camera",frame);
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSAib3BlbmN2MlxvcGVuY3YuaHBwIgoKdXNpbmcgbmFtZXNwYWNlIGN2Owp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4odm9pZCkKewogICAgVmlkZW9DYXB0dXJlIGNhcHR1cmU7CiAgICBNYXQgZnJhbWU7CgogICAgY2FwdHVyZS5vcGVuKDApOwogICAgaWYoISBjYXB0dXJlLmlzT3BlbmVkKCkpCiAgICB7CiAgICAgICAgY291dCA8PCAiTm90IE9wZW4iIDw8IGVuZGw7CiAgICAgICAgd2FpdEtleSgxMDAwMCk7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CgogICAgbmFtZWRXaW5kb3coIk9yaWdpbmFsIENhbWVyYSIpOwogICAgY291dDw8IjxFU0M+IC0gcXVpdCB0aGUgcHJvZ3JhbSI8PGVuZGw7CgogICAgZm9yKDs7KQogICAgewogICAgICAgIGNhcHR1cmUgPj4gZnJhbWU7CiAgICAgICAgaWYoICh3YWl0S2V5KDMzKSAmIDI1NSkgPT0gMjcgKQogICAgICAgIHsKICAgICAgICAgICAgY2FwdHVyZS5yZWxlYXNlKCk7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBpbXNob3coIk9yaWdpbmFsIENhbWVyYSIsZnJhbWUpOwogICAgfQoKICAgIHJldHVybiAwOwp9Cg==