Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import cv2
  2. import sys
  3. import numpy as np
  4. import serial
  5. import struct
  6. import time
  7.  
  8.  
  9.  
  10.  
  11. if __name__ == '__main__' :
  12.  
  13.  
  14.  
  15.  
  16.  
  17. # Read video
  18. video = cv2.VideoCapture(0)
  19.  
  20. #ok, frame = video.read()
  21. while(True):
  22. # Read a new frame
  23. ok, frame = video.read()
  24.  
  25. if not ok:
  26. break
  27.  
  28. # Display result'
  29. cv2.imshow("Tracking", frame)
  30. # Exit if ESC pressed
  31. if cv2.waitKey(1) & 0xFF == ord('q'):
  32. break
  33. video.release()
  34.  
  35. cv2.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement