Sunday, July 31, 2011

IGARSS 2011 Vancouver - Redux (So that you don't fall asleep)

It took a lot of messing around and changing flights to get there but thanks to the excellent folk at Flight Centre Melbourne Airport I arrived on time , left Melbourne 25th July Morning 10:30am and arrived in Vancouver 25th July 7:30am. Again proving the fact that a teleporter is indeed equivalent to a time machine.

Screen shot 2011-07-31 at 6.03.47 PM

This monday turned out to be full-on 48hour monday, lots of interesting sessions to go to. I attended the plenary by Shimada San introducing ALOS-2 and ALOS-3 with next generations of the great optical and SAR sensors we have come to expect from the Japanese. May be I can sneak into the CALVAL stage and score another trip to Japan.


More flight dramas continued in the background, the presentations blurred into a constant stream of words and diagrams on my sketchbook in the foreground. I learnt a lot about what has been done in the past year and what is coming over the horizon.

I saw science solving political problems with cross-boundary river basin monitoring with Poseidon, Jason-1 and in the future Jason-2. Important basins across unfriendly countries such as Indus, Ganges, Brahmaputra and the Mekong can be monitored by the international science community and appropriate alerts sent and action taken when one of the partner nations or the weather in the river basin begins to misbehave.

I saw the cold-gas (NO2) driven engines that keep TerraSAR-X and Tandem-X locked in their helical dance, not forever, only till the global elevation model project is complete or the gas runs out - whichever comes first. Some extra effort will be required to collect the elevation model of Antarctica, since the satellites will need to be rolled to face left. This is where the polar observation satellites - Cryosat-2 and more, will make a great impact.

I used the conference services a fair bit as well and got labelled "the troublemaker" - thanks people. If you want to get in touch with me just search for the troublemaker at IGARSS.

The real highlights of the week however were the impromptu dinner get-togethers. After the poster session on Monday I drifted off with SAR people from Spain and a few other places. Tuesday night was spent with the OTB team and a fun Columbian guy from ITC. Scientists on one night, engineers on another, we discussed the transition from Science to Engineering to Products, and the effort and mindsets it takes to go the next step, and how the last step provides continuing fuel for the first. The next night it was back to science setting up a collaboration aimed at just such a transition for the OTB ESA Summer of Code in Space (ESA SOCIS 2011). Thursday evening I had great stroll through the Sun Yat Sen garden, dinner at Shukaku and a movie at the Scotiabank Theatre - ultimate self indulgence. Friday, went to very few sessions and spent most of the time in Stanley park sketching totem poles, before catching a flight out. Thank you for a great time Vancouver - I will definitely be back.

Thursday, July 21, 2011

Getting some fish into WorldWind

Last few days I have gone back to biological data, well animal tracks. CSIRO has put together a very nice oceantracks website using the amazing Indie game engine - Unity 3D (amazing in every way except running on Linux). It runs on Android, so with some effort on GL-ES front it can be made to work on Linux.



Talking about multi-platform game engines the other impressive one is Ardor3D,  not that OGRE or Irrilicht are bad. It is just easier to get going without getting platform specific binaries or needing to set up a large tool-chain. It is also easier to maintain the Java based game engine on top of JOGL and LWJGL instead of maintaining JNI bindings to a C++ engine (especially if your bindings are outside the source tree) . The other large draw from Ardor is the JOGL based rendering which lets us share the GLContext between Ardor and WorldWind, as I have done in jaxb-collada (lots of thanks to the original Ardor hack post and improvements from niccastel and brujito). Some pretty famous use-cases have picked Ardor up as their rendering engine including the Mars rover project, I hope to catch up with them in a few weeks. May be the local guys down here in Hobart will adopt it as a mission control system for the SLOCUM Gliders.


There are some altitude setting bugs in the Ardor3D+WorldWind code , and the animations key-frames are not enabled, but the models load nicely and will look great with some more water surface shaders and actual track data.

WorldWind_Tuna

Friday, July 15, 2011

GSOC 2011 - Sub-surface Features in WorldWind

Honestly I did not sign up to mentor this project, but I kind of drifted into throwing some advice by the way of the student. Doing a prototype of sub-surface visualisation is not at all difficult, but it is difficult to get it right, to convey the information without losing the context provided by the draped textures.

California Seismic or Australia Boreholes data goes down into the earth's crust. The crust is not that thick (only a few 10's of km in the 6000 or so km's of earth radius). Thinks get a bit weird in portraying things accurately while using vertical exaggeration. The surface of the earth becomes a bit of an event horizon. Nevertheless good progress has been made with changing the transparency of the surface textures and deploying secondary meshes below the normal terrain mesh. The aim is to get something close to Rockworks. The implementation so far tweaking secondary meshes in WorldWind can be seen here:

Tuesday, June 28, 2011

GSOC 2011 - PyOssim

The awesome Ossim library has served me (and disaster situations in New Orleans and Haiti) in getting large amount of imagery processed accurately and without too much manual messing around.

OSSIM already sports a JNI wrapper tying the rich C++ library to the JVM (I loathe to say Java - it is such a verbose and bureaucratic language). Coming from C++, an Ossim wrapper should attach to a more dynamic language. Indeed the OMAR developers chose to write it mostly in Groovy+Grails.
Ship Tracks in OssimPlanet

This year the GSOC project is aiming to wrap some important bits of the vast library using SWIG for use in CPython. Writing a SWIG wrapper can be painful at the best of times as I found out during my Kinect SWIG work. In spite of the hurdles Vipul has made decent progress and made some of the previous work with JNI + SWIG compile in the Python context. Now he is starting fresh from a purely Python perspective, we will figure out which functions are important and should form the seed for a python wrapping project.

If it all becomes too hard to do with CPython, we might stick with the link to JVM and script Ossim with Jython.

Sunday, June 26, 2011

GSOC 2011 - Ship Detection in Opticks

This is my second mentoring stint for the Google Summer of Code. I am advising on 3 separate projects in different capacities.
  1. Ship + wake detection and parameter estimation using Radar images in Opticks
  2. Wrapping the awesome OSSIM library in python
  3. Displaying sub-surface features in a 3D globe - NASA WorldWind
This post is going to be the first in a series describing the goals of each of the projects and where we are so far in them. In my personal opinion given the complexity of the algorithms involved and the visual outputs the ship detection project has progressed the farthest. We are using a beautiful 3m TerraSAR-X image from DLR as the basis for our implementation.

The various algorithms we have thrown in include:

1) CFAR with k-distribution model of the clutter
2) Elliptical width, height and orientation estimation
3) Isodata clustering for ship points
4) Linear feature (wake) detection with radon transform
5) Conversion of ship to wake displacement to ship velocity using satellite trajectory and imaging mode

Vijay is in his 5th week now and has been making great progress, picking up algorithms from various examples and adapting them to Opticks.

Monday, June 20, 2011

WebGL globes round up - in the face of security

WebGL bring the the OpenGL Embedded Systems (ES) profile to the virtual machine that the web browser is rapidly becoming. Microsoft has hit the headlines in the last few days with their proclamations about the security holes created by WebGL and their reluctance to fix them. They might be trying to plug any holes in their answer to high performance graphics in the browser - Silverlight, may be they can reuse the silverlight code to plug the GPU access security holes.

I wasn't going to rant about IE's double-standards but summarise a few WebGL globes I have come across, so here goes:
  1. A very early port of NASA WorldWind API to WebGL - Lanyard.
  2. The Swiss OpenWebGlobe.
  3. Google's data visualisation globe.
  4. WebGL Earth from Klokan.
  5. Godzi globe from Pelican.
Let us just hope that Microsoft pulls its head out of the sand and works on securing GPU access via no-matter which technology. Meanwhile I will rush off to build a video buffer capture with handhacked versions of JOGL (if anyone ever accepts my signature). What Javascript really needs is establishment of trust and signed execution.

Sunday, June 19, 2011

Why choose a language when you can be a Polyglot

Flamewars between language fanatics often gets in the way of "getting things done". I pick up languages fairly quickly and appreciate their benefits and short comings. After a fair bit of survey it seems like no language will instantly have familiarity and features concurrently, not unless it is also attached to a time machine and a brain washer. So why not call a truce and support them all (or most) - on a half-decent industry standard VM (no matter how much you dislike oracle).

Dynamic languages are a lot of fun to develop with, you can create prototypes quickly and have a tight feedback loop of your application taking shape. Sometimes the heuristics built into an application are not the right ones (u,v in vector interpretation are swapped, some format loader does not quite do what you expect). The expert/inquisitive user should be able to fix these vagaries at runtime and make the application behave. Any self-respecting application should include such dynamic scriptablity (Qgis does via CPython/SIP, Geoscript is nascent).
Matlab JSR-223

The REPL based languages that we are aiming to support via JSR 223 include:
  1. Jython - with standard JSR 223.
  2. JavaScript - with Mozilla Rhino, browser JNI bindings can be lobbed in as needed.
  3. JRuby - again we get JSR 223 for free.
  4. Groovy - the standard interface is not enough for delving in the depths of Groovy, but it does the job.
  5. R - I hacked together a placeholder based on the JNI based rJava project, there are standard implementations but they don't play along nicely with our integration framework yet.
  6. Perl - Another day another hack for the Inline::Java JNI based calls to the Perl interpreter.
  7. Matlab - I had a chance to delve deep into the innards of Matlab and discovered a native and jvm based beast. There are several hacks to talk to Matlab from Java including running your Java code on the same VM Matlab is running (it even includes the felix runtime and scr). For now I am using matlabcontrol with some JSR-223 linkage.
The current integration tests with patchwork hooks to convert SUN Spi to OSGi Services looks something like below.


INFO: Testing Script Engine: jython
Jun 19, 2011 12:53:36 PM org.trikend.script.test.ScriptTest testConsole
INFO: Testing Script Engine: javascript
Jun 19, 2011 12:53:36 PM org.trikend.script.test.ScriptTest testConsole
INFO: Testing Script Engine: jruby
Jun 19, 2011 12:53:37 PM org.trikend.script.test.ScriptTest testConsole
INFO: Testing Script Engine: groovy
Jun 19, 2011 12:53:37 PM org.trikend.script.test.ScriptTest testConsole
INFO: Testing Script Engine: R
Jun 19, 2011 12:53:38 PM org.trikend.script.test.ScriptTest testConsole
INFO: Testing Script Engine: perl
Jun 19, 2011 12:53:38 PM org.trikend.script.test.ScriptTest testConsole
INFO: Testing Script Engine: matlab

A JSR-223 bridge may not do it justice and we may have to write our entire high-reliability portion of the system in Erjang, but that will not stop me from adding an Eshell to the integration test next. The java scripting project feels dead for a year, possibly due to Oracle turmoil, if there is any news on this front and Github forks alive and kicking I would really like to know. Other syntaxes and languages with fun features to evaluate would be: Scala + Akka, Clojure and Gosu.