In the immortal words of Burt Bacharach:

Beware of The Blob, it creeps
And leaps and glides and slides
Across the floor
Right through the door
And all around the wall
A splotch, a blotch
Be careful of The Blob

It’s true, Burt. Tracking multiple blobs in an image for motion tracking, in order to analyze a video source to track points of movement within that image, is hard. The open source, multimedia processing Pure Data library Gridflow does a lovely job in a new patch by Mathieu Bouchard. Found via the excellent PD-Announce list, which manages to be useful but not overwhelming. Mathieu writes:

It’s actually my own implementation: it’s not been ported from anywhere else. Each cross is centered on the centroid (1st order moment) of its corresponding region (“blob”), and the size of the cross is the square root of the area of the region.

I will make another version which will use rotated rectangular crosses. The two lines of each cross will represent the two radiuses of the standard deviation of the region, and the angle will represent the angle of the standard deviation. I will use [#moment_polar], an abstraction based on [lti.Jacobi].

Mathieu explains how to get it (ain’t open source great?):

If you get your GridFlow from the CVS, just update and you’ll have [#labeling].

(It’s called like that because it “labels” each region of the picture with a different number, so it creates something called “a labeling”).

You’ll find lots of Pure Data goodness at Mathieu’s site. See the full image of the patch.

Mostly, I’m going to use this as yet another excuse to go grab the pure:dyne Linux distro. GridFlow and Pd are already on there, so you need to know very little about setting up Linux and installing them. pure:dyne should be Intel Mac ready any day now, and it’ll boot from a key, a hard drive, or a disc, so it’s very easy to just boot it up and give this stuff a go. I’m dying to run it on my MacBook, so I’ll post here once that version becomes available. (Note, Mathieu observes that of course this is too new to be on pure:dyne yet … but that’s okay with me; it still demonstrates the utility of Gridflow, and there’s nothing stopping you from using pure:dyne as a starting point and switching to CVS if you can handle a little bleeding-edge code.)

  • Awesome, thanks for spreading the word about Pd!

  • Pingback: Workshop New Media – Bart « wtrhs_TM()

  • Hi Peter.  I stumbled on to your web site cause I’m looking for ball tracking and scoring software for billiards/pool.  Can you recommend a starting point for me that I could use to start building my own maybe?  I prefer opensource/cheap software that I can use in combination with a web cam.  I want the software to measure approximate distances between balls, track their color and how many of them are on a table, and how far they travel on a known table size.  I assume users would need to calibrate the camera/tracking into a defined area based on their web cam angle/position or that the software would make an educated guess based on standard criteria of table sizes. The software would also automatically track/count balls potted and aggregate scores for two players based on knowing what balls are missing from a table.  It doesn’t have to be terribly accurate in tracking ball positions but within an inch or better would be good.  I assume also, that users would typically setup their web cams at an angle facing the table.

    Is what I describe even possible with motion tracking software?  I’m assuming from looking at this blog post, that maybe what I want to do can be done.