Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- import cv2
- import numpy as np
- import time
- HOST = '192.168.1.10'
- PORT = 50505
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- print('Socket created')
- s.bind((HOST, PORT))
- print('Socket bind complete')
- s.listen(10)
- print('Socket now listening')
- conn, addr = s.accept()
- while True:
- data = conn.recv(8192)
- nparr = np.fromstring(data, np.uint8)
- frame = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
- cv2.imshow('frame', frame)
- time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement