Processing + Java + blobDetection = Question?XD
Posted: 06 July 2008 06:19 PM   [ Ignore ]
New Member
Rank
Total Posts:  5
Joined  2008-07-06

Hi there, i’m new on this forum and also new to the MT technology. Its been 4 days that I do nothing more than just watch movies, pdf, tutorials, etc.. and today i’ve started coding with Java and I got this question.. I’m using processing libs and a lib called blobDetection from http://www.v3ga.net/processing/BlobDetection/, there is a project called lowres that makes blob tracking and also creates osc messages...I’ve been studying that code and ended up making one of my for tracking blobs… and the question is how can i send the x and y infos for multikey for example...i know that it works with touchlib and so i thought if i create a osc message equal to the ones created in touchlib than the flash app multikey would work too...am I thinking correctly? if you like i can post all the code here but it’s still at the begining....

Thanks all and I really LOVE all the work you all do here with all the projects!!! :D

Profile
 
 
Posted: 07 July 2008 06:06 AM   [ Ignore ]   [ # 1 ]
Sr. Member
Avatar
RankRankRank
Total Posts:  265
Joined  2007-09-22

Why would you use Java for blobDetection when you have touchlib that is written in C++ and way faster than anything java could coup?

Profile
 
 
Posted: 07 July 2008 03:28 PM   [ Ignore ]   [ # 2 ]
New Member
Rank
Total Posts:  5
Joined  2008-07-06

hm..i know that but i’ve been learning Java at the university and wanted to aplly my knew knowledges and i have some dificults in C++ but i’ll give it a try :D is there any place where touchlib is fully commented or any place that could make it easier for me to understand its working ? btw thanks for the reply :D

Profile
 
 
Posted: 07 July 2008 04:48 PM   [ Ignore ]   [ # 3 ]
Sr. Member
Avatar
RankRankRank
Total Posts:  265
Joined  2007-09-22

Well you should investigate the RealBasic thread. Touchlib sends OSC messages , and inside them you find blob x and y coordonates.

You app first has to parse those messages , then you can do whatever you want with them , just leave touchlib doing the tracking , it’s just better this way.

Profile
 
 
Posted: 07 July 2008 05:31 PM   [ Ignore ]   [ # 4 ]
New Member
Rank
Total Posts:  5
Joined  2008-07-06

i see...i’ve been trying to compile this basic example http://nuigroup.com/forums/viewthread/1380/#9652 however i can’t make it run...it compiles with no problem but when running the app it pops up an message box saying that touchlibd.dll was not found...:S how can i solve this problem?:D thanks !

Profile
 
 
Posted: 08 July 2008 07:09 AM   [ Ignore ]   [ # 5 ]
New Member
Rank
Total Posts:  86
Joined  2007-10-22
Vlado - 07 July 2008 06:06 AM

Why would you use Java for blobDetection when you have touchlib that is written in C++ and way faster than anything java could coup?

My Java blob tracking running at 60 fps with a Firefly MV takes between 5-20% of a 3.0 GHz Pentium D (to be precise, it’s not only blob tracking but additionally also a simple gesture recognition). Would be even less on a modern dual-core processor. Touchlib sucked until the recent improvements/corrections were made. Conclusion: Algorithms and the way you do things are more important than the programming language used. There could be an advantage for C++ when you’re doing something really CPU-heavy, but blob tracking definitely isn’t that heavy (unless you do it at 300 fps).

Still, I would recommend to use Touchlib and not build yet another blob tracking software. wink

Profile
 
 
Posted: 08 July 2008 08:41 AM   [ Ignore ]   [ # 6 ]
Sr. Member
Avatar
RankRankRank
Total Posts:  265
Joined  2007-09-22

The blob tracking isn’t , that’s the simple part but after that touchlib examines everyframe to see wich blob was what in the frame that just passed.
C++ is usally alot faster than Java beacause java runs in a virtual machine , anyway it all depends on what you do with it and how you use it.

Profile
 
 
Posted: 08 July 2008 09:03 AM   [ Ignore ]   [ # 7 ]
New Member
Rank
Total Posts:  5
Joined  2008-07-06

I see..i’m starting with C++ apps and also Processing to receive OSC messages from touchlib...i mean why to invent the wheel if it is perfectly invented? smile it was just for curiosity but now i know how it works (i think) and so i think i’m able to create some basic apps using TUIO and OSC protocol :D i’m gonna try create a virtual keyboard controlled by the blobs...lets see how it works eheh :D

Profile
 
 
Posted: 08 July 2008 09:41 AM   [ Ignore ]   [ # 8 ]
New Member
Rank
Total Posts:  86
Joined  2007-10-22
Vlado - 08 July 2008 08:41 AM

but after that touchlib examines everyframe to see wich blob was what in the frame that just passed.

That’s what I meant with “blob tracking”; Finding the blobs and find the corresponding ones from the previous frame. Using the simple brute force approach for that is not elegant, but given that you don’t have more than 30 or so fingers at the same time, it should be alright regardless of whether you use C++ or Java.

Also, C++ can be a lot faster in a number of disciplines when you use the right compiler and choose the right optimisations. But I guess not so many of us have bought the Intel compiler, which is simply superior to the others.

Anyway, learning and using C++ is something every programmer should do, as you learn a lot of how things actually work on the low level. Actually, in my opinion you should first learn C(++) and then Java and not the other way round. smile

Profile
 
 
Posted: 08 July 2008 09:54 AM   [ Ignore ]   [ # 9 ]
New Member
Rank
Total Posts:  86
Joined  2007-10-22

As a kind of real-world example, take this speed comparison of Box2D, a C++ 2D physics engine, and its Java port JBox2D. The Java version is not that much behind C++, and it has not been optimised yet to better fit the Java style.

Profile
 
 
Posted: 08 July 2008 09:59 AM   [ Ignore ]   [ # 10 ]
New Member
Rank
Total Posts:  5
Joined  2008-07-06

Anyway, learning and using C++ is something every programmer should do, as you learn a lot of how things actually work on the low level. Actually, in my opinion you should first learn C(++) and then Java and not the other way round. smile

I know that, i’ve already learned C++ last year at the school but no one ever teached me how to program with oriented objects however this year i’ve been learning Java and thats why i think i can work better with Java....wtv...lets learn C++!:D uhuh!^^

I also think that it is more important to have a well made algorithm than just use brute force...blob tracking can be a heavy process…

Profile
 
 
Posted: 09 July 2008 10:45 PM   [ Ignore ]   [ # 11 ]
New Member
Rank
Total Posts:  30
Joined  2008-05-23

Wasn’t touchlib written using Visual Studio? I thought I read that it was which meant that they had to go through the process of porting it so that it could be run on Linux. There is only one Java (so far) so it is very portable and you can be sure that the application will work the same no matter which system it is run on.

I simply want to use Java because I am currently learning how to do advanced Swing programming with Java 2D so I will be able to create very nice interfaces for my MT apps using Java. I do plan on learning WPF later which appears to do in VS what Swing and Java2D do in Java.

I imagine that in the not too distant future this type of discussion won’t take place because MT won’t be primarily for hobbyists and enthusiasts anymore. I imagine that it will be common for displays to be sold that will handle all of the hardware related aspects including the tracking and they simply send the data to applications much like a mouse and keyboard do now.

Profile
 
 
Posted: 11 July 2008 03:20 AM   [ Ignore ]   [ # 12 ]
Sr. Member
Avatar
RankRankRank
Total Posts:  265
Joined  2007-09-22

Lux is a new platform based of touchlib , it will be crossplatform , so any code made for windows will work on linux and osx. Just wait for it’s release.

Profile
 
 
Posted: 11 August 2008 03:09 AM   [ Ignore ]   [ # 13 ]
New Member
Avatar
Rank
Total Posts:  54
Joined  2008-07-15
Vlado - 08 July 2008 08:41 AM

The blob tracking isn’t , that’s the simple part but after that touchlib examines everyframe to see wich blob was what in the frame that just passed.
C++ is usally alot faster than Java beacause java runs in a virtual machine , anyway it all depends on what you do with it and how you use it.

Isn’t this only applicable when allocating and loading resources?
Once the code has been translated to machine code by the VM, it should run about just as fast.
Sure, there would be a tiny bit more delay, but once it’s allocated the resources and memory for the tracking, i don’t expect there would be any noticable delay v/s C / C++ blob-tracking.

Profile
 
 
   
 
 
‹‹ CamTrax      OSCPack Compile Errors ››