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

OpenCV Basics

Posted on Sun 15 April 2018 in OpenCV • Tagged with opencv, python

OpenCV is a library of computer vision functions available for C++, Java, Python, and more on Windows, Linux, OS X, Android, and iOS. The OpenCV project began way back in 1999 and has been continually expanded and improved since then.

This article and the others on this site focus on …

Continue reading

Build OpenCV and install from source

Posted on Tue 27 March 2018 in OpenCV • Tagged with python, opencv, anaconda

(Originally posted at

I wanted to set up the latest OpenCV version on my Mac. I found various instructions, but few that applied specifically to my setup — Mac OS X High Sierra running Anaconda. What follows are my steps to compile and install the latest OpenCV version onto …

Continue reading