Latest revision: blobtrack_rev2.zip (attached below). Background subtraction, outputs via OSC, and now includes an OSC receive / unpack patch.
Dependencies:OpenSoundControl object (follow link & scroll down), and the cv.jit package.
It’s working nicely - let me know how you make out! If you don’t have any sort of screen set up, the first revision (blobtrack.zip) contains a test movie.
Original post:
Hi,
I use a Mac and can’t run Touchlib or OpenTouch, so I’ve written a basic blob tracker in Max/MSP. The patch spits out X-Y coordinates and area for each blob. I’ve included it here w/ test movie - suggestions/improvements are welcome. Please note that this patch depends on the cv.jit externals by Jean-Marc Pelletier, so download and install them before using.
hi,
sounds interesting, since i can’t try that out until next week, i would like to ask if this works still fast, if the coordinates are transmitted with OSC to Processing or Flash?
Did somebody try that?
cheers!
yes, in the current version of my patch the coordinates are transmitted over OSC (using the OpenSoundControl external from CNMAT). I have no clue about Processing, although I’m sure there’s an OSC client for it. Flash receives OSC messages with flOSC, which is pretty dated but still works. My colleague on this project has rewritten it in ActionScript 3, and will hopefully post it on the forums soon.
As for speed, I am running it on a MacBook Pro, with a dual 2.16 GHz chip (Core Duo) and 2 gigs of RAM - it’s pretty processor intensive, but I haven’t had any problems yet.
I can post my latest patch this weekend if you want to check it out.
Good, you figured it out. I guess I should edit that first post to be more clear about the dependency.
So, the version you have doesn’t send anything via OSC - I added that functionality later. Also, I pruned down the processor consumption in the later version. Will post when I get some time to clean it up for sharing. Until then, have fun with whatcha got! Do you have any sort of screen setup yet, or are you just checking out the software side first?
today i will set up the screen, with acrylic glass and DI Setup. later, i guess, i will try the osc connection. could you tell me, how the CNMAT stuff works? i downloaded and unziped it, and i found pretty much a whole bunch of patches. but i remember, that there was also a different way, which was only a small part in a patch and worked really slick.
Cool. It’s probably included in the package you downloaded, but if you go back to the CNMAT site that I linked above and scroll about halfway down, there’s an item called OpenSoundControl. Download the version that fits your platform (MachO for Intel Mac, CFM for PPC Mac, or Windows) and then you can install them. Put the .mxo in your MaxMSP/Cycling ‘74/externals folder, and the .help file in your MaxMSP/max-help folder. Then double-click the .help file and you can figure out how the object works
hi, thanks. ok i figured out how it works. but i did not really understand how to include that into the blob-detection patch. I looked at the different help files, but i did not find out how to get the data given out by «jit.unpack 3» send with the OSC protocoll?
hi again,
i now tried to send it using MaxLink, but i don’t get the data from the matrix sent or connected to the MaxLink Object.
How could i get the singel fields of the matrix to a message box or directly to the object for sending?
Thanks!
Thanks for a great patch - that got me started a bit, but i run in to a problem when receiving the OSC data in max/msp. When i unpack the messages i miss the Y-coord. Do you have any sample patch that shows how to recive the OSC data and unpack it in the right way.
Glad it worked out for you – I’ve updated the download in the original post to include a basic OSC unpacking patch. Note that there is a slight change in the blobtrack_share patch as well, so don’t use your old one or the blobcount won’t work properly.
I would like to implement the TUIO protocol in the future, but at the moment I need to focus on getting audio happening in my patch, because this is my senior thesis project :D However, I’m working with a fellow student who is an excellent Flash programmer, and he’s rewritten the flOSC client in AS3. I’ve been encouraging him to post his work on the forums, so hopefully it’ll happen. Until then, using the existing flOSC stuff here, it’s possible to communicate (albeit very basically) from Max to Flash and back. Hopefully we can get a more advanced implementation going soon!