In the past, I've used the Python imaging library to blend images and place text overlays on frames. I recently wrote a version that does this in one single script, using OpenCV for manipulating the images. Maybe it's useful to someone...
I find Slack extremely useful for collaborating with a team. It's also great for quickly and easily getting notifications about the status of a script that's running on a remote computer somewhere. In my case, I'm running bioinformatics pipelines that take hours or days to run. Slack notifications tell me when programs finish running, or if something odd has happened.
Below are two code snippets I've found useful:
Timelapse video of a house demolition with a time-stamp overlay
Sadly, our neighbors sold their house and it was recently demolished to make way for two new buildings. On the plus side, this gave me an opportunity to try out my Raspberry Pi camera and make a time lapse movie of the process. Specifically, I wanted to try a quick-and-easy way to add a time-stamp in the corner of the video to give an indication of the current time of the day.
A short description of a program for tracking vehicles written in C++ using the OpenCV library. The goal is to count cars and collect statistics of estimated vehicle speeds. An adaptive background segmenter (MOG) and a perspective transform are used to pre-condition the video frames. If contours are found, their coordinates are fed to a Tracker class, which employs a Kalman filter and an assignment algorithm to keep vehicle identities straight.
My security camera has been running great for months. Issues have arisen only when the wireless router gets restarted or the wireless connection gets lost for some other reason. The problem is that the Raspberry Pi doesn't automatically reconnect after a wlan connection is dropped. Here's a possible solution to the problem that doesn't involve unplugging the RPi.
SASS/Compass with MacPorts on El Capitan. This is mostly a note to myself
When updating to El Capitan, my compass and sass installations had disappeared once again. But when I tried to just install the compass and sass gems with the system's build-in Ruby, I got a bunch of error messages like the ones shown here:
A few months ago I bought the fabulous book "The Nature of Code" by Daniel Shiffman. Instead of recreating the book's examples and exercises in Processing, I translated them to C++, using the Cinder library. This project is too large to house on my private web site, so here's a link to the wiki and code repository on BitBucket:
A Python script that's using OpenCV to open a video, loop it, and trigger playback via a command coming from the serial port (where in my case an Arduino is connected) or a key press. Playback stops after a timer has run out and commences after another trigger event.
It's common knowledge that MacBooks and iMacs can be controlled with any Apple remote. This feature is turned on by default, so unless people manually disable remotes, or pair a specific remote to their computer, they are easy victims for a simple prank. You can control the volume, start/pause songs in iTunes, advance and go back a song in the library, and, most annoyingly, enter FrontRow by pressing the appropriate button on the remote. Of course, it would be nice not to actually have to approach the "prankee" with a conspicuous Apple remote. It would be far nicer to have a microcontroller mimic the IR codes and control everything remotely…