Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jun 19th, 2018 59 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include "opencv2/opencv.hpp"
  2.  
  3. using namespace cv;
  4.  
  5. int main(int, char**)
  6. {
  7.     VideoCapture cap(0); // open the default camera
  8.     if(!cap.isOpened())  // check if we succeeded
  9.         return -1;
  10.  
  11.     Mat edges;
  12.     namedWindow("edges",1);
  13.     for(;;)
  14.     {
  15.         Mat frame;
  16.         cap >> frame; // get a new frame from camera
  17.         cvtColor(frame, edges, COLOR_BGR2GRAY);
  18.         GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
  19.         Canny(edges, edges, 0, 30, 3);
  20.         imshow("edges", edges);
  21.         if(waitKey(30) >= 0) break;
  22.     }
  23.     // the camera will be deinitialized automatically in VideoCapture destructor
  24.     return 0;
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top