Skip to content

Instantly share code, notes, and snippets.

@wwj718
Last active July 26, 2019 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwj718/0f6bee8a53358e3fe111dbeca18e7198 to your computer and use it in GitHub Desktop.
Save wwj718/0f6bee8a53358e3fe111dbeca18e7198 to your computer and use it in GitHub Desktop.
import cv2
import sys
import imagezmq
image_hub = imagezmq.ImageHub()
while True: # show streamed images until Ctrl-C
rpi_name, image = image_hub.recv_image()
cv2.imshow(rpi_name, image) # 1 window for each RPi
k = cv2.waitKey(1)
# k = cv2.waitKey(0)
if k == ord('t'):
cv2.imwrite('rpi.png',image)
if k==ord('q'):
sys.exit(0)
image_hub.send_reply(b'OK')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment