Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import socket
  2. import time
  3.  
  4. import cv2
  5.  
  6. capture = cv2.VideoCapture(0)
  7. sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  8. sock.connect(('192.168.1.10', 50505))
  9.  
  10. while True:
  11. ret, frame = capture.read()
  12. data = cv2.imencode('.jpg', frame)[1].tostring()
  13. sock.sendall(data)
  14. time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement