Created
July 26, 2019 03:53
-
-
Save wwj718/7a658bf66e10430c83f1cb53cdd8dc21 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 socket | |
import time | |
from imutils.video import VideoStream | |
import imagezmq | |
sender = imagezmq.ImageSender(connect_to='tcp://wwj-macbook.local:5555') | |
rpi_name = socket.gethostname() # send RPi hostname with each image | |
picam = VideoStream(usePiCamera=True).start() | |
time.sleep(2.0) # allow camera sensor to warm up | |
while True: # send images as stream until Ctrl-C | |
image = picam.read() | |
sender.send_image(rpi_name, image) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment