Every now and then, I blast out the cruft from my nerd gland’s exit duct by writing a terribly nerdy post. This is just such a post, so if you don’t speak Nerd, i’d highly recommend that you go have some fun elsewhere, at least until my next Weekly Head Voices of course!
As mentioned around these parts, I’m currently playing with Processing, a beautiful programming stack for making interactive visual, err, thingies. To be more specific, I’d like to use processing together with something like ARToolkit to do real-time 3D tracking of markers in live video, for augmented reality fun. To see what this could look like, see this YouTube video:
Today’s challenge is getting whole stack, including processing, the GSVideo video capture library for processing and the NyARToolkit augmented reality for processing going on Linux x86_64 (64bit). On Linux x86 (32bit) this is much more straight-forward, but I wouldn’t write a blog post about straight-forward, now would I?
Here is the recipe:
- Make sure you have the native 64bit Sun JDK installed for your system. On this Ubuntu 9.10 machine it’s sun-java6-jdk 6-15-1, on Ubuntu 10.04 (also tested) it’s 6.20dlj-1ubuntu3.
- Also install the jogl libraries, on this machine called libjogl-java.
- Make sure you have the whole of gstreamer installed. On ubuntu, all packages containing “gstreamer”.
- Get and unpack the processing for Linux tarball (I’ve tested this whole procedure with processing 1.0.9, 1.1 and 1.2.1) from the processing download site.
- In the unpacked processing directory, remove the whole java subdirectory. Now make a symlink pointing to your system java directory (the one containing bin, ext, jre, lib, etc.). On my system, that was:
cd processing rm -rf java ln -s /usr/lib/jvm/java-6-sun-1.6.0.15 java
- In processing/libraries/opengl/library remove the 3 libjogl*.so files and libgluegen-rt.so. Symlink their replacements from /usr/lib/jni with for example:
cd processing/libraries/opengl/library rm lib*.so ln -s /usr/lib/jni/libgluegen-rt.so ln -s /usr/lib/jni/libjogl_awt.so ln -s /usr/lib/jni/libjogl.so
- Download and unpack gsvideo into processing/libraries. You should be able to run the examples in processing/libraries/gsvideo/examples/Capture with the PDE (Processing Development Environment).
- Download and unpack the NyARToolkit for Processing library into processing/libraries.
You should now be able to run the NyARToolkit examples by changing replacing the import call as follows:
// replace this call: // import processing.video.*; // by this call: import codeanticode.gsvideo.*;
and changing the Capture class (twice) to GSCapture and perhaps also the capture resolution, depending on your camera. The relevant conversions are:
// Capture cam; // becomes: GSCapture cam; // later, in setup(): // cam=new Capture(this,width,height); // becomes: cam=new GSCapture(this,width,height);
The major trick in all of this is converting your Processing installation to use your system 64bit JDK instead of its own built-in 32bit JDK.
Let me know in the comments if this worked (or didn’t) for you!
Related posts:
Charl Botha // Mar 5, 2010 at 09:14
Need to get #Processing + video capture (and artoolkit) going natively on 64 bit linux? Read my blog post: http://bit.ly/dumevP
Thanks, it also worked using Ubuntu Lucid Lynx :D
BTW have you tried to get PyARTK installed in 64 bit?
I’ve not played with PyARTK yet. Have to stay focused on processing! :)
Many thanks. You make my day !
Damian Garcia // May 20, 2010 at 18:16
Processing + GSVideo + NyARToolkit on Linux x86_64 http://bit.ly/aEz2xF #AugmentedReality
Michele Dallachiesa // May 26, 2010 at 15:37
http://cpbotha.net/2010/03/04/processing-gsvideo-nyartoolkit-on-linux-x86_64/
can you send me this source code of the video above please?
That video is not mine. Best you could do is go onto youtube and message the owners.
Ok, Thanks anyway!
Ben Bull // Aug 18, 2010 at 13:09
Nerdy ARToolkit + P55 – http://is.gd/encO6