PyCon Pittsburgh. April 15-23, 2020.

Talk: Yin Yang Ranch: Building a Distributed Computer Vision Pipeline using Python, OpenCV and ZMQ

Presented by:

Jeff Bass


I am building a small permaculture farm in Southern California. I have written computer vision programs in Python to read the water meter, optimize water use, track coyotes, rabbits, raccoons and bobcats, etc. The farm is set up like an ongoing science project. I am running Python on 20 Raspberry Pi computers with PiCameras and sensors. The RPi’s capture images, detect motion and select a subset of images. Did the water meter move? Was a coyote seen? If so, images are sent to a hub computer via PyZMQ. The hub computer uses Python and OpenCV to do more advanced processing like reading the water meter digits or keeping critter counts by season. This arrangement demonstrates ways that Python can be helpful in developing IOT networks with multiple cameras and sensors.

In this talk I will describe the hub and spoke design that distributes processing across a mix of RPi’s and larger computers. I’ll cover the pros and cons of PyZMQ messaging for image transfer. I’ll describe OpenCV techniques in Python that have been helpful on both the RPi’s and the hub computer. All the programs are pure Python, and they leverage fast libraries written in C, like OpenCV and ZMQ by using Python bindings. This is an open source project with all the Python source code available on GitHub. Hardware “how to’s” & photos are also on GitHub. Pictures of my farm and my favorite coyotes are also on GitHub…because why not?


Watch on YouTube