SHARE
TWEET

Untitled

a guest Jun 25th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import cv2
  2.  
  3. cv2.namedWindow("preview")
  4. vc = cv2.VideoCapture(0)
  5.  
  6. if vc.isOpened(): # try to get the first frame
  7.     rval, frame = vc.read()
  8. else:
  9.     rval = False
  10.  
  11. while rval:
  12.     cv2.imshow("preview", frame)
  13.     rval, frame = vc.read()
  14.     key = cv2.waitKey(20)
  15.     if key == 27: # exit on ESC
  16.         break
  17.     else:
  18.         cv2.line(img=frame, pt1=(700,5), pt2=(5, 450), color=(255, 0, 0), thickness=1, lineType=8, shift=0)
  19.  
  20. vc.release()
  21. cv2.destroyWindow("preview")
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