5.24
This commit is contained in:
19
lane_server/test_camera_recv.py
Normal file
19
lane_server/test_camera_recv.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import zmq
|
||||
import numpy as np
|
||||
import cv2
|
||||
|
||||
|
||||
context = zmq.Context()
|
||||
socket = context.socket(zmq.SUB)
|
||||
socket.connect("tcp://localhost:5555")
|
||||
socket.setsockopt_string(zmq.SUBSCRIBE, '')
|
||||
|
||||
while True:
|
||||
message = socket.recv()
|
||||
np_array = np.frombuffer(message, dtype=np.uint8)
|
||||
frame = cv2.imdecode(np_array, cv2.IMREAD_COLOR)
|
||||
cv2.imshow("Received", frame)
|
||||
if cv2.waitKey(1) == 27:
|
||||
break
|
||||
|
||||
cv2.destroyAllWindows()
|
||||
Reference in New Issue
Block a user