From 40a8e89c9ba9e42505e7ee180f689632ddedbffd Mon Sep 17 00:00:00 2001 From: Mike Langmayr <1809691+mikelangmayr@users.noreply.github.com> Date: Mon, 21 Sep 2026 14:24:46 -0700 Subject: [PATCH 1/2] Add a sample Python reader for the camerad ImageStreamIO stream --- README.md | 8 ++ python/examples/shm_read_frames.py | 180 +++++++++++++++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 python/examples/shm_read_frames.py diff --git a/README.md b/README.md index 9c74faf..15fc13b 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,14 @@ Publishes each frame as an [ImageStreamIO](https://github.com/milk-org/ImageStre Frame geometry (width/height/pixel depth) isn't a config key: it's fixed for an ImageStreamIO stream's whole life, so the writer (re)creates the stream automatically whenever it sees the geometry change from what's currently allocated. +Two readers ship with the repo. `camerad-shm-reader` prints geometry, keywords and pixel statistics once, for diagnostics. `python/examples/shm_read_frames.py` is a sample streaming consumer: it blocks on the stream's semaphore and reports every frame as it arrives, flagging any it missed. + +```bash +$ python python/examples/shm_read_frames.py --segment hispec_tracking_camera --count 10 +``` + +It needs numpy and `ImageStreamIOWrap`, the Python wrapper from the ImageStreamIO source tree, built with `-DPYTHON_WRAPPER=ON`. Neither the wrapper nor this script is on PyPI. + ## Exposure Time `exptime [