Raspberry Pi for IoT

Posted on Fri 14 December 2018 in Making, Python • Tagged with raspberry pi, making, python

I gave a presentation to the Buffalo Python meetup group in December. My talk centered around using the Raspberry Pi as a platform for IoT and embedded development. I want to share my presentation and the resources I mentioned here on my blog.

Update I presented an expanded version of …


Continue reading

Getting user input with OpenCV trackbars

Posted on Tue 16 October 2018 in OpenCV • Tagged with opencv, python

Trackbars, or sliders, are a simple way to get user input when working with OpenCV. In this post, I’ll show you how to add trackbars to an OpenCV window, read their values, and use those values in your Python scripts.

Trackbars (sliders) on an OpenCV window

To demonstrate a use for trackbars, we’ll read …


Continue reading

Multiple cameras with a single Raspberry Pi

Posted on Sun 02 September 2018 in Python • Tagged with python, raspberry pi, making

The Arducam Multi Camera Adapter board is a neat accessory for a Raspberry Pi. With it, you can connect multiple cameras to a single Pi. A single board supports up to four cameras. According to Arducam, you can stack up to four boards for a total of 16 cameras on …


Continue reading

Finding the dominant colors of an image

Posted on Tue 24 July 2018 in OpenCV • Tagged with opencv, python

The typical way to isolate or find an object in an image is to look for its color. You specify a range of colors, then use OpenCV to identify regions in an image that contain colors within that range. But, even if you know the exact color of your target …


Continue reading

Ad-hoc objects in Python

Posted on Fri 06 July 2018 in Python • Tagged with python

If you know one programming language, it's natural to look for parallels as you learn a new language. In my case, I've coded in JavaScript for many years while Python is much more recent for me. I regularly find myself thinking "in JavaScript, I'd do ..."

Take object handling. I really …


Continue reading

Path prediction with OpenCV

Posted on Sun 03 June 2018 in OpenCV • Tagged with opencv, python

Recently, I spotted an article on HackerNews, Self-driving RC car that uses AI to predict turning angles. The project looked interesting. They applied AI to predict the path a radio-controlled car should take to stay centered over a tape track on the floor. Using a Raspberry Pi and PiCam mounted …


Continue reading

Handling mouse events in OpenCV

Posted on Mon 21 May 2018 in OpenCV • Tagged with opencv

For a project I'm working on, I need to select a region of interest in a video frame and extract info about that region. Fortunately, that's a pretty simple task to do in OpenCV. In this article, I'll show you how to detect and react to mouse actions, such as …


Continue reading

Reading email with Python

Posted on Thu 10 May 2018 in Python • Tagged with python

For a recent project at work, I needed to read and parse email messages with a python script. I found the documentation confusing, and most of the samples on various blogs and StackOverflow posts to be old and not fully compatible with python 3.x. So, here is an adaptation …


Continue reading

Streaming birdcam with a Raspberry Pi and picamera

Posted on Fri 04 May 2018 in Making • Tagged with raspberry pi, making, python

My darling wife got me a Raspberry Pi 3B+ and a NOIR Pi camera for my birthday so that I could set up a streaming camera to monitor our nesting bluebirds. Here's how I did it.

My first attempt was to use the Motion program as described by Hackernoon. It …


Continue reading

Acquiring images with OpenCV

Posted on Mon 16 April 2018 in OpenCV • Tagged with opencv, python

To manipulate an image, the first thing you must do is open it. OpenCV lets you open images and videos from files and cameras, both locally attached and on the network. Let's check it out.

Still images

We'll start with the simple case of still images. This is probably best …


Continue reading