Last active
March 3, 2017 05:23
-
-
Save h2suzuki/2bd49dfd4f4f5b71029b55d5434f716a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import zmq | |
import zmq_utils | |
# Setup ZeroMQ image publisher & receiver | |
context = zmq.Context() | |
sub = context.socket(zmq.SUB) | |
sub.setsockopt_string(zmq.SUBSCRIBE, "image") | |
sub.set_hwm(1) | |
sub.connect("tcp://localhost:5558") | |
pub = context.socket(zmq.PUB) | |
pub.set_hwm(1) | |
pub.connect("tcp://localhost:5559") | |
print("Starting...") | |
while True: | |
image = zmq_utils.recv_image(sub) | |
zmq_utils.send_image(pub, image) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment