Skip to content

Instantly share code, notes, and snippets.

View jeffbass's full-sized avatar

Jeff Bass jeffbass

View GitHub Profile
@jeffbass
jeffbass / zmqimage.py
Last active November 6, 2022 16:59
zmqimage.py -- classes to send, receive and display OpenCV images from a headless computer to a display computer using cv2.imshow()
# zmqimage.py -- classes to send, receive and display cv2 images via zmq
# based on serialization in pyzmq docs and pyzmq/examples/serialization
'''
PURPOSE:
These classes allow a headless (no display) computer running OpenCV code
to display OpenCV images on another computer with a display.
For example, a headless Raspberry Pi with no display can run OpenCV code
and can display OpenCV images on a Mac with a display.
USAGE:
@jeffbass
jeffbass / imagezmq.rst
Last active May 1, 2019 19:52
DRAFT for Testing how GitHubGist displays .rst file

imagezmq: Transporting OpenCV images

Introduction

imagezmq is a set of Python classes that transport OpenCV images from one computer to another using PyZMQ messaging. For example, here is a screen on a Mac computer showing simultaneous video streams from 8 Raspberry Pi cameras:

@jeffbass
jeffbass / more-details.rst
Last active May 26, 2020 23:13
DRAFT for Testing GitHub formatting of documentation rst file

More details about the multiple RPi video streaming example

The beginning of the README.rst for this GitHub repository showed a screenshot of a Mac computer displaying simultaneous video streams from 8 Raspberry Pi cameras:

images/screenshottest.png

@jeffbass
jeffbass / imagezmq-uses.rst
Created March 4, 2018 05:07
DRAFT for testing GitHub rendering of imagezmq-uses.rst file

Using imagezmq in Distributed Computer Vision Projects

The test programs show how imagezmq can be used to capture images on Raspberry Pi computers, send them to a Mac via imagezmq and then display them on the Mac. The ability for one hub to gather and process images from multiple sources allows computer vision pipelines to distribute vision processing across multiple computers.

@jeffbass
jeffbass / api-examples.rst
Last active July 23, 2018 19:10
DRAFT for Testing API.rst

API and Usage Examples

The API for imagezmq consists of 2 classes with 2 methods each. The ImageSender class has 2 methods: one for sending an OpenCV image and one for sending a jpg compressed OpenCV image. The ImageHub class has 2 methods: one for receiving an OpenCV image and one for receiving a jpg compressed OpenCV image.

@jeffbass
jeffbass / yyr.rst
Created March 16, 2018 21:36
DRAFT for Testing yyr.rst

yin-yang-ranch: Software & Raspberry Pis that Manage a Farm

Introduction

yin-yang-ranch is a collection of Python programs and Rasperry Pi hardware to help manage a small urban permaculture farm. The 2 acre farm is an ongoing science project to build living soil, capture rain in barrels, and grow a

@jeffbass
jeffbass / imagenode.py
Last active August 24, 2018 00:22
A snipped of imagenode.py
#imagenode.py snippet
# (all the imports, logging setup hidden for now)
settings = Settings() # get settings for node cameras, ROIs, GPIO
node = ImageNode(settings) # start ZMQ, cameras and other sensors
# forever event loop
while True:
node.get_sensor_data() # grab camera images and other sensor data
node.process_sensor_data() # detect motion, etc.
while len(node.msg_q) > 0:
try:

imagezmq: Transporting OpenCV images

imagezmq is a set of Python classes that transport OpenCV images from one computer to another using PyZMQ messaging. For example, here is a screen on a Mac computer showing simultaneous video streams from 8 Raspberry Pi cameras:

https://raw.githubusercontent.com/jeffbass/imagezmq/master/docs/images/screenshottest.png

@jeffbass
jeffbass / badge_fetch.rst
Last active February 13, 2020 06:20
Fetch RST implementation of badges for README.rst from shields.io & DOI
@jeffbass
jeffbass / test_create_image_jpg_buffer.py
Created March 24, 2020 21:36
imageZMQ test program to check jpg_buffer type, size and dimensions
"""test sending a jpg buffer and check type & size of buffer
A simple test program that creates an image, then converts it to a
jpg_buffer and checks the type(), ndim, size and shape of the jpg_buffer.
This program tests some imports and some OpenCV functions, as well.
Open Source Licensed under MIT License (MIT)
Copyright (c) 2020, Jeff Bass, [email protected]
"""