fork download
  1. #include <iostream>
  2. #include "opencv2\opencv.hpp"
  3.  
  4. using namespace cv;
  5. using namespace std;
  6.  
  7. int main(void)
  8. {
  9. VideoCapture capture;
  10. Mat frame;
  11.  
  12. capture.open(0);
  13. if(! capture.isOpened())
  14. {
  15. cout << "Not Open" << endl;
  16. waitKey(10000);
  17. return 1;
  18. }
  19.  
  20. namedWindow("Original Camera");
  21. cout<<"<ESC> - quit the program"<<endl;
  22.  
  23. for(;;)
  24. {
  25. capture >> frame;
  26. if( (waitKey(33) & 255) == 27 )
  27. {
  28. capture.release();
  29. break;
  30. }
  31. imshow("Original Camera",frame);
  32. }
  33.  
  34. return 0;
  35. }
  36.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty