Getting Blob Size from CCV via TUIO? 
Posted: 02 August 2010 01:16 AM   [ Ignore ]
Rank
Joined  2009-05-01
Total Posts:  18
New Member

Hello,

I’ve been working with TUIO from CCV, but I recently added DI setup to current FTIR setup to detect objects on the table. However, i don’t think current version of CCV does not support addObject event yet. I just want to retrieve sizes of blobs on the surface to decide if it’s an object(big) or a blob(small).

Is there anyway to get size of a blob via TUIO?

Thanks in advance.

Profile
 
 
Posted: 01 September 2010 08:46 AM   [ Ignore ]   [ # 1 ]
Rank
Joined  2010-07-23
Total Posts:  18
New Member

Hi there,

I know its an old thread here, but I would like to know also…

any suggestions ?

thx

Profile
 
 
Posted: 22 September 2010 05:18 AM   [ Ignore ]   [ # 2 ]
Rank
Joined  2010-09-21
Total Posts:  16
New Member

Hi!

The problem I see so far with tracking the blob geometry data is, that hardly any tracking framework provides them via protocol.

But someone wrote that CCV 1.2 (get it here) is sending the blob width and height when you turn on the ‘send height and width’ option in the GUI (which actually really works wink ). The values are then attached to the ‘cur’ messages at the end.

I’m also experimenting with this stuff recently, so if you find anything new, please let me know.

Profile
 
 
Posted: 22 September 2010 05:41 AM   [ Ignore ]   [ # 3 ]
Rank
Joined  2010-07-23
Total Posts:  18
New Member

Yo,

on the CCV v1.3 I actually made a mad hack, so that additionally to the cur-messages a ocg-message is sent, which conains the previously calculated contour-data. From there ignoring the rest this works fine for. But still its not ready…

Profile
 
 
Posted: 27 February 2011 05:18 AM   [ Ignore ]   [ # 4 ]
Rank
Joined  2010-09-21
Total Posts:  16
New Member

Hi!

I did a little modification in CCV so it sends blob data (width, height, area, angle) using the TUIO protocol.

CCV
- For getting the blob data from CCV I took CCV 1.4 from here http://amitsarangi.wordpress.com/2010/09/02/ccv-1-4/ .
- If there are any trouble getting it to compile/run see the comments of the blog articles at http://amitsarangi.wordpress.com/ or NUI forum (Quicktime, VC Redistributable, ... must be installed).
- In the TUIO.cpp some lines must be added to send the ‘/tuio/2Dblb’ profile:

if(bFingers){
        map
<intBlob>::iterator blob;
        for(
blob fingerBlobs->begin(); blob != fingerBlobs->end(); blob++){
            
// omit point (0,0) since this means that we are outside of the range
            
if(blob->second.centroid.== && blob->second.centroid.== 0)
            continue;

            
//***** Modification of message arguments ******
            //Set Message
            
ofxOscMessage set;
            
set.setAddress"/tuio/2Dblb" );
            
set.addStringArg("set");
            
set.addIntArg(blob->second.id);                // id
            
set.addFloatArg(blob->second.centroid.x);    // x
            
set.addFloatArg(blob->second.centroid.y);    // y
            
set.addFloatArg(blob->second.angle);
            
set.addFloatArg(blob->second.boundingRect.width);    // wd
            
set.addFloatArg(blob->second.boundingRect.height);    // ht
            
set.addFloatArg(blob->second.area);    // calculate area
            
set.addFloatArg(blob->second.D.x);            // dX
            
set.addFloatArg(blob->second.D.y);            // dY
            
set.addFloatArg(0.0f);                        // as
            
set.addFloatArg(blob->second.maccel);        // ma
            
set.addFloatArg(0.0f);                        // ra
            
if(bHeightWidth){
                set
.addFloatArg(blob->second.boundingRect.width);    // wd
                
set.addFloatArg(blob->second.boundingRect.height);    // ht
            
}
            b
.addMessageset );                            // add message to bundle
            
alive.addIntArg(blob->second.id);                // add blob to list of ALL active IDs
        
}
        
        b
.addMessagealive );        //add message to bundle
        
b.addMessagefseq );        //add message to bundle
                //Don't forget to send the actually created message
        
TUIOSocket.sendBundle);      //send bundle
}

Also notice line

TUIOSocket.sendBundle);

were the message is sent, because this was originally missing in the downloaded version (perhaps it’s already corrected).
- Compile it
- Notice that you must check the ‘Track Fingers’ in CCV to send the ‘/tuio/2Dblb’ messages. No ‘/tuio/2Dcur’ are sent, because of the modification.
- It turns out that the blob angle is not usable because of massive jitter, but looking at the contact area gives pretty good results.

TUIO Java Client Libs
- To use the sent TUIO data in Java/MT4J some additions have to be made in the TUIO Client library.
- Outline: new TuioBlob class, mods in TuioClient and TuioListener (see attachment)
- (compile it into a .jar for using it with MT4J)

Enjoy wink

File Attachments
TUIO_JAVA_2DBLB.zip  (File Size: 185KB - Downloads: 293)
CCV1_4-2Dblb.zip  (File Size: 14976KB - Downloads: 291)
libTUIO.jar  (File Size: 19KB - Downloads: 148)
Profile
 
 
Posted: 12 September 2011 04:19 AM   [ Ignore ]   [ # 5 ]
Rank
Joined  2011-08-22
Total Posts:  10
New Member

Hy reini,

would it be possible for you to upload the compiled version for windows? I get about 65 errors when trying to compile it.
Maybe it’s also possible to upload the .jar. When I try to copile this, all the classes are missing.

That would be fantastic.
Thank you very much…

Profile
 
 
Posted: 12 September 2011 10:49 AM   [ Ignore ]   [ # 6 ]
Rank
Joined  2010-09-21
Total Posts:  16
New Member

hi! i just added them to my previous post.

as mentioned, for compiling CCV see also the comments in amits blog and check if Quicktime, VC Redistributable, ...are installed.

Profile
 
 
Posted: 12 September 2011 10:56 AM   [ Ignore ]   [ # 7 ]
Rank
Joined  2011-08-22
Total Posts:  10
New Member

Thank you so much. But it seems, the TUIO_JAVA_2DBLB is damaged.
And in my old version, I had a TUIO.jar and a libTUIO.jar. Can I use my old “TUIO.jar”?

best regards

Profile
 
 
Posted: 12 September 2011 01:25 PM   [ Ignore ]   [ # 8 ]
Rank
Joined  2010-09-21
Total Posts:  16
New Member

No problem. I havn’t been working on that project recently… so be patient wink

Maybe you can give a small description of what you are about to do and the things that don’t work to figure out whats wrong.

You only need the libTUIO.jar and don’t forget to include it in your project/put it in the classpath.

Profile
 
 
Posted: 12 September 2011 02:00 PM   [ Ignore ]   [ # 9 ]
Rank
Joined  2011-08-22
Total Posts:  10
New Member

Hy, it’s just, that the .zip file is damaged and can’t be unziped.
What I’m working on is a finger tracker with CCV and I want to use it in Processing. That worked fine with CCV 1.4.1 Multicam (I have 2 Firefly Cameras), and the Processing Tuio Library (From the Tuio Website).
But now I need the Size and the Angle of the Fingerblobs. After some search I found this thread and your solution.

Profile
 
 
Posted: 13 September 2011 10:57 AM   [ Ignore ]   [ # 10 ]
Rank
Joined  2011-08-22
Total Posts:  10
New Member

Hy,

today I made it and compiled the CCV version with the changes. But now I don’t get any Tuio Touches into the processing app and also the javasample doesn’t work.
I think the problem is, that the TUIO.jar is not compatible with the libTUIO.jar in the processing libraray folder. I always get the error: ClassNotFoundException: com.illposed.osc.OSCListener
Maybe someone has an idea?

Thank you very much.

Attached I have uploaded the library files and my processing file.

File Attachments
library.zip  (File Size: 22KB - Downloads: 137)
protuio_20110913.zip  (File Size: 2KB - Downloads: 145)
Profile
 
 
Posted: 13 September 2011 02:25 PM   [ Ignore ]   [ # 11 ]
Rank
Joined  2010-09-21
Total Posts:  16
New Member

Hi!

Sounds pretty interesting using it for visuals!

Sorry, I’m away from my computer right now, but I’ll try to figure it out tomorrow.
When using the packets remember that the packets are sent to the “/tuio/2Dblb” address (see CCV mod) and so you have to use the TuioBlob objects.

Profile
 
 
Posted: 14 September 2011 08:58 AM   [ Ignore ]   [ # 12 ]
Rank
Joined  2011-08-22
Total Posts:  10
New Member

Hy,
I’ve already thought about the /tuio/2blb address, but I have no idea, how I can make it in Processing.
I think the problem comes more from the TUO.jar and the libTUIO. But I couldn’t find any src or similar for the TUIO.jar

If I don’t paste the tuio.jar into the library folder I get an error of a missing library. If I copy it there together with your libTUIO.jar, I get the mentioned error.

Profile
 
 
Posted: 14 September 2011 04:50 PM   [ Ignore ]   [ # 13 ]
Rank
Joined  2010-09-21
Total Posts:  16
New Member

Hi!

Ok I think I figured it out finally. The problem was, that the OSC libs which are normally included in the .jar file havn’t been included in the jar I provided.
To get things started, here is a complete eclipse project with the correct libTUIO.jar libraries. So at first try to get this running. Send the TUIO packages from CCV to port 3333 and run the TuioDump.java . Now you should see all Tuio messages printed to the console.
I hope it works now wink

File Attachments
NUI2Dblb.zip  (File Size: 36KB - Downloads: 181)
libTUIO.jar  (File Size: 34KB - Downloads: 156)
Profile