silent drum – tracking

<< PREVIOUS: Hardware: Building

Once the drum is ready, we need to setup tracking. If you are unsure if this will work in OS X or Linux, then you can also try this first. [1. If you have to use windows, this will not work out of the box. However, all the sources for the objects are inside the src folder for you to compile. I don’t have a windows machine and can’t make that happen. right now. If you manage to compile all or some of these externals, please send them to me to include them. Current versions of gem already contain pix_drum and other of my externals in the /extra folder, so if you download a precompiled version of GEM you’ll be able to use these objects. You can also follow Epic Jefferson’s instructions for windows.]

First you’ll need a copy of Pd or Pure Data for your operating system.

In the event that you are using the same camera that I am, the PS3eye, you will also need to make sure that you have the correct drivers for your operating system. A small tutorial on how to install these drivers is found here.

Tracking and sound patches are separate for processing reasons and to allow sending the tracking data to other programs such as Max/MSP or others. It is currently sending messages through netsend/netreceive.

Download the tracking patch for osx and linux here.[2. This version supports: OS X 10.5+ intel macs and Linux x86_64 (64 bit). For Windows see previous footnote.]

Uncompress and open the main.pd patch. This will load a pre-compiled library of GEM as well as best_match and fill0s externals. If you have Pd pointing to another copy of GEM you need to disable it. If you’d like to have pix_drum in your own copy of GEM you can include the sources in the /pixes folder and recompile or get the latest GEM. [3. As mentioned previously, pix_drum is now in the extra folder of GEM, so you can get it from GEM too.]

main.pd patch for video tracking

In the main.pd patch there is a select camera option. This is only helpful in OS X. It will open a dialog to choose the camera and frame rate, as long as you have the correct drivers for the PS3 EYE camera. In this dialog you should also select the 320×240 resolution.

In linux it should go directly to the PS3eye camera, if it is the only video device open. Size and frame rate must be set separately through modprobe.[4. I commonly use:

modprobe -r gspca_ov534
(to remove the module)
modprobe gspca_ov534 videomode=14 autogain=0 exposure=60
(to load the driver with a 320×240 resolution and fixed exposure at 75 fps)
All parameters are listed here and here. Thanks to Kaswy for the hack!!]

A window should be created automatically, but you can create a window in the “create window” dialog at the top.

Most video tracking parameters are already set in advance for 320×240 resolution. You will only need to adjust the threshold to your own lighting situation. The other variables are left there in case you want to explore what they do.

You’ll also need to adjust the bounds to the area of analysis desired. Right and left should reach the edges of the drum (of the open area). top should be right below the spandex head and bottom should be adjusted to the lowest the head can be pressed.

Once variables are set, press the “save” button to save the variables. They will be loaded automatically the next time you open the patch.

Once the receiving (netreceive) patch is open, press connect to send the data.

It is important to note that the camera must be correctly positioned before tracking. Ideally, the left and right extremes of the video shot must fit the edges of the drum. This will constraint the distance. The key point however is that the drum head must be flat. If it is pointed from below or from above, you will see a black oval; if it is perfectly positioned you’ll see a line. This constraints the angle. (a matter of perspective…)

The output of this patch is described here. You can also consult the pix_drum-help.pd patch in the /src folder.

Let me know if something is missing…

<< PREVIOUS: Hardware: Building


2 thoughts on “silent drum – tracking

  1. Pingback: Hardware: Building

  2. Pingback: HOW TO build a Silent Drum

Leave a Reply

Your email address will not be published. Required fields are marked *