1 of 2
1
Max/MSP Blob Tracking Patch
Posted: 16 October 2007 03:53 PM   [ Ignore ]
Rank
Joined  2007-10-01
Total Posts:  17
New Member

UPDATED 03/13/2008

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.

Jesse

File Attachments
blobtrack.zip  (File Size: 677KB - Downloads: 2513)
blobtrack_rev.zip  (File Size: 12KB - Downloads: 1582)
blobtrack_rev2.zip  (File Size: 16KB - Downloads: 2494)
Profile
 
 
Posted: 05 February 2008 10:10 AM   [ Ignore ]   [ # 1 ]
Rank
Joined  2008-02-05
Total Posts:  8
New Member

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!

Profile
 
 
Posted: 05 February 2008 09:13 PM   [ Ignore ]   [ # 2 ]
Rank
Joined  2007-10-01
Total Posts:  17
New Member

Hi,

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.

Profile
 
 
Posted: 06 February 2008 07:02 AM   [ Ignore ]   [ # 3 ]
Rank
Joined  2008-02-05
Total Posts:  8
New Member

nice, that would be awsome, i am looking forward to try that out.

Profile
 
 
Posted: 06 February 2008 07:40 AM   [ Ignore ]   [ # 4 ]
Rank
Joined  2008-02-05
Total Posts:  8
New Member

have downloaded the first patch, but ist says error that:

cv.jit.blobs.sort: No such Object
cv.jit.blobs.centroids: No such Object
cv.jit.lable: No such Object
cv.jit.blobs. centroids.draw: No such Object

i have MAX/MSP and Jitter installed, but never really used it before.
What is the problem?

Profile
 
 
Posted: 06 February 2008 07:47 AM   [ Ignore ]   [ # 5 ]
Rank
Joined  2008-02-05
Total Posts:  8
New Member

done, forgot to install the cv.jit package http://www.iamas.ac.jp/~jovan02/cv/download.html

Profile
 
 
Posted: 06 February 2008 12:11 PM   [ Ignore ]   [ # 6 ]
Rank
Joined  2007-10-01
Total Posts:  17
New Member

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?

Profile
 
 
Posted: 07 February 2008 05:10 AM   [ Ignore ]   [ # 7 ]
Rank
Joined  2008-02-05
Total Posts:  8
New Member

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.

Profile
 
 
Posted: 07 February 2008 08:21 AM   [ Ignore ]   [ # 8 ]
Rank
Joined  2007-10-01
Total Posts:  17
New Member

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 smile

Profile
 
 
Posted: 07 February 2008 08:29 AM   [ Ignore ]   [ # 9 ]
Rank
Joined  2008-02-05
Total Posts:  8
New Member

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?

Profile
 
 
Posted: 08 February 2008 06:07 AM   [ Ignore ]   [ # 10 ]
Rank
Joined  2008-02-05
Total Posts:  8
New Member

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!

Profile
 
 
Posted: 24 February 2008 09:47 PM   [ Ignore ]   [ # 11 ]
Rank
Joined  2007-10-01
Total Posts:  17
New Member

I’ve updated the patch to send data out through OSC. See the original post above. Hope this helps out!

Profile
 
 
Posted: 13 March 2008 09:56 AM   [ Ignore ]   [ # 12 ]
Rank
Joined  2008-02-10
Total Posts:  6
New Member

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.

best regards,
Per

Profile
 
 
Posted: 13 March 2008 04:24 PM   [ Ignore ]   [ # 13 ]
Rank
Joined  2007-10-01
Total Posts:  17
New Member

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.

Profile
 
 
Posted: 13 March 2008 09:06 PM   [ Ignore ]   [ # 14 ]
Avatar
RankRankRankRank
Joined  2006-11-09
Total Posts:  1499
Administrator

Any news on TUIO support for this patch? It would be awesome to have Max/MSP talking to Flash (AS3)

Here is a related thread that might interest you… http://nuigroup.com/forums/viewthread/1495/

 Signature 

~

Profile
 
 
Posted: 13 March 2008 09:59 PM   [ Ignore ]   [ # 15 ]
Rank
Joined  2007-10-01
Total Posts:  17
New Member

Hi cmoore,

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!

Profile
 
 
   
1 of 2
1