Category Archives: Code

A tool for labelling the pose of objects in 3D monocular videos

labellerpicAs a part of my project on monocular 3D model-based tracking, I created a GUI tool for labelling poses in video sequences. The tool will interpolate between labelled frames, reducing the work required by the user in labelling the frames.

The idea is to use this labelled data with image-space error measures, since the eye of the labeller will almost certainly not distinguish the depths of objects with any degree of certainty. This is okay because in the first instance we are interested in human-level performance. This idea is discussed further in sections 3.7 and 7.2 of my thesis.

The labelling tool can be found here:

If you make use of this software, please cite my PhD:

Duff, D. J. (2011, December). Visual motion estimation and tracking of rigid bodies by physical simulation (PhD Thesis). University of Birmingham. Available at

CCalc/SWI Prolog/Point Cloud Library — external predicate example

While I was preparing a guest lecture, I created the following example of a SWI Prolog external predicate interfacing into the Point Cloud Library (PCL). A CCalc (action language interpreter built with SWI Prolog) example is provided also. The readme should do the explaining.

The toy example given is multi-robot path planning with obstacles obtained by finding the ground plane and then counting points above the plane (the example uses cropped Kinect data from one of the PCL sample files).

Python interface to CCalc

As a part of my work I have created and am using a Python interface to CCalc, an interpreter for a portion of the C+ action language. The Python interface communicates with the program via pexpect. It may be of use to someone.

The latest version is here:

Simple Python Colour Tracker

A couple of months ago I spent a couple of days and whipped up this exceedingly simple Python colour blob tracker for a project of a friend. It is very simple but it should get the job done for applications that only need to track the image position of some simple coloured objects. Unlike much of my code, it is self-contained and I have made it to be easily usable and so it may be of use to someone.

It can be used standalone or from your python script and instructions are given on the repository landing page. You set it to learn a nearest-neighbour pixel colour classifier (where the exemplars are found by k-NN clustering) which it will then use to track image blobs (using a rather adhoc but computationally efficient method).

The code can be found here: