Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (15 sloc) 385 Bytes
import zmq
import numpy as np
import matplotlib.pyplot as plt
import cv2
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect("tcp://192.168.0.3:5555")
socket.send_string('read')
image = socket.recv_pyobj()
print(np.min(image))
print(np.max(image))
plt.imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
plt.show()
socket.send_string('stop')
print(socket.recv_string())