Friday, February 4, 2011

OTB-GPU and Amazon AWS (Cuda Enabled) - Cloud Processing

A while ago OTB did some experiments running image processing code on GPU's. It has not made it to mainline yet since we are waiting on ITK to add more structured and pervasive support for GPU's in their infrastructure. I though it would be a nice bit of code to test the not-so-new but still shiny Amazon AWS Cuda support.

The preconfigured instance with Nvidia CUDA toolkit installed runs CentOS 5. You will need additional repositories to grab goodies like cmake and mercurial to get going, from RPMForge. You will need lots and lots of version controls e.g. subversion and mercurial, even compilers. I should have started from the GIS AMI.Getting GDAL installed as a dependency can be slightly tricky, the CentOS packages from ELGIS did not work form me, lot's of missing dependent libraries. Best bet is to install from source. Then use a small hack to copy over some headers and build OTB.
Hudson Nodes
Build servers like Hudson can easily make use of such an image on AWS once configured with the right version control, configuration and build tools. I will have to test drive the Hudson CMake support with this instance. Otherwise I have been playing puppet master at home with Virtual Box and real hardware. I got the swarm plugin to register most my available platform to hudson as a build slaves, including the BeagleBoard. AWS can be accessed via a similar cloud/cluster plugin. I found the VirtualBox plugin rather cryptic, I think I will have to use the source for that one - it can be very useful for multi-platform installer and GUI testing, even recording instruction videos by playing through a UI test suite. Especially when using bootstrappers, errors are not detected at compile time. They only become apparent when the program is run on a clean system. Having a set of clean virtual machine snapshots makes it much easier to track down the error before it is released into the client base.

Thursday, January 27, 2011

Collada Models everywhere - WorldWind and COVE

Last few days I have had a lot of fun hooking one JOGL rendering engine into another. The fantastic Ardor 3D engine is designed with games in mind and WorldWind globe renderer interact nicely with each other. Ardor does not hog the GL context and behave as if it is the only thing with the run of the place. WorldWind can do the globe rendering then Ardor takes over to insert say a vertex shaded waving water layer and some buildings on fire.

105 macquarie st
There are the expected fights over z-buffer and texture caches, but a few context back-up restores in Java can take care of that. I had a bit of fun raiding the Google 3D warehouse for models and throwing them in. In some cases the positioning and scaling was not quite right, but the model framework established from joglutils and jaxb-collada work lets me specify this quite easily.

We also had a fantastic demo from Keith, developer of the COVE (Cooperative Ocean Visualisation Environment). Had nice chats about merits of scene segmentation trees from BSP to Hyper-Octrees(obviously harder to implement). He manages to keep decent performance with a wealth of features. Showing hundreds of arrows without VBO's can kill performance, but at least it keeps working on integrated graphics cards.
Current Vectors in COVE
Note to self: avoid DNS srv record madness for Google Talk, manually add the chat server If you are unable to fix the DNS settings, specify talk.google.com in the "Connect Server" field in the "Advanced" tab.

Tuesday, January 18, 2011

Starting work at CSIRO - after a long holiday

It was been a great December and January. We have seen a lot of Tasmania, gone for a few great walks - 5 hour Freycinet loop and few hours up Mt. Wellington. I have made some progress on editing a chapter and lots of progress on making a connection sharing point for multiple USB modems on my BeagleBoard (not that the USB-Ethernet hub can sustain the juice multiple modems draw).

The key ingredient turned out to be the udev rule to automatically insert the modem driver (good old usbserial) when the device was detected on the usb bus:
ACTION=="add", SUBSYSTEM=="usb", MODALIAS=="v05c6p0015*", RUN+="/sbin/modprobe usbserial vendor=0x05c6 product=0x0015"

Beyond this the nm-connection-editor tool (from the NetworkManager coterie) was used to add a Vodafone connection with the relevant APN. Now whenever the modem is plugged in ModemManager kicks in and a ppp connection is established without any more fuss.

First day at the new office in Csiro , ip phone and cove in the alcove
First couple of days at CSIRO have also gone swimmingly with a lot of help from my peers (Gary mostly). I spent sometime reading manuals and doing design decisions with GeoAPI. Got indoctrinated into the CSIRO way and spent sometime staring at stack traces from SAP. Otherwise I am really enjoying the shiny new Mac with lotsa RAM, time to kick around some shaders in WorldWind.

Friday, December 31, 2010

Moving to Hobart - First few days

Last few weeks I have been trudging (well driving) across Australia from Adelaide to Hobart. Before leaving Adelaide we had a small farewell. Even though my Facebook estimate was 12, I invited other people on the side and the total headcount came to 28.
Packed like sardines while boarding the ferry, traffic jam on the pier
The next few days were spent on the road and on the ferry, Adelaide-Melboune(and environs)-Devonport (and environs)-Hobart. We went to several national parks near Devonport. Narawntapu along the coast where we saw crabs swarming along the beach.

Then we had a close-up with a wombat at the Cradle Mountain National park. Finally we got to Hobart and had a "Bah Humbug Christmas"(according to the organizers) at the waterworks park.

In a few days we watched "Wild Oats" sail into Hobart marking beginning of the end of the Sydney to Hobart race. More exciting summer things to do in Hobart coming up.
Close encounter with the wombat kind, cradle mountain, in the button grass #fb
Watching wild oats come into Hobart, end of Sydney to Hobart race

Wednesday, December 8, 2010

Beagle has 3 eyes - Kinect + Beagleboard

People have hooked up the Kinect to a few embedded platforms - Intel Atom and Gumstix Overo have come up. It was time for the other darling of open development, the BeagleBoard to talk to the Kinect. I have done stereo on the beagleboard before. The kinect makes things a lot easier.



First the usual step of getting libfreenect going, I ended up using unstable since it includes the OpenCV bindings. The sync API is much more stable than the callbacks and has fewer frame drops. Since I don't have a spare keyboard/mouse set for the Beagle and Synergy refused to co-operate, I did a demo frame viewer run with OpenCV rendering the frames. I had to upgrade opencv, ffmpeg, libusb, cmake and bunch of things on Angstrom, then replace CMake opencv detection with pkg-config to get everything working.

#kinect tested to work with #beagleboard and opencv #openkinect
Meanwhile there have been some major changes in the OpenKinect world with PrimeSense releasing the OpenNI framework. This releases the Microsoft stigma from the Kinect and encourages more open source development of applications. You can grab the OpenNI code from Github and build on your platform a from the manufacturer kinect driver. No stigma about a hacked Kinect (or shall we say PrimeSensor) any more either, it is officially open.

Monday, December 6, 2010

JAXB + Collada 1.4 Schema = Messy method names

Collada Reference ModelNASA WorldWind Java has recently added extensive KML support. They use neither SAX nor DOM, but a very creative solution with an XML pull parser. The events of interest i.e. implemented KML features only are responded to and corresponding objects created. So the pull based methodology is more flexible - faster than SAX and less memory hungry than DOM. One of the planned things is models, and given the interest in KML shown at the CSIRO Cop meeting I decided to have a shot at extending the worldwind KML support.

Collada Box in WorldWind3D models have been around on the forums in a mega thread for a while now, but never truly integrated into the worldwind core. With KML model support proposed this might finally be on the way. I got my feet wet in Collada parsing by creating annotated Java classes from the Schema using JAXB. I have to admit I made some primitive attempts with DOM + XPATH parsing and quickly gave it up in favour of pure JAXB magic. Parsing a simplistic Blender cube took some effort, I have the vertices, faces and normals done. Just need to set up some materials to get it to render.

Wednesday, December 1, 2010

CMAR Community of Practice - day 2

On the 2nd day the concept of divisions in CSIRO has sunk in and I realize that this is the CSIRO Marine and Atmospheric Research Software Engineering community, I am over the me and them mentality as well and I am using the "We" pronoun more often.
Large KML GE

Large KML WW
The talks today started off with a review of XML and why it is not the solve all. The second talk explored the REST idiom for web services. There were a couple of talks about IMOS and TERN indexing disparate NetCDF and HDF data and allowing exploration + download of it via a portal. The inevitable scalability question came up and was left as the elephant in the room. A very detailed talk about Oracle databases and optimizations was an eye opener for me - somebody used to the relatively "just should work" world and PostgreSQL. The last talk felt like a major reimplementation of Google Docs in a semantic space, to easily digest arbitrary data from spreadsheets - the goal is lofty but the proof is in the pudding.

We tried to muster up some support for a visualization platform around NASA WorldWind for community wide acceptance and there was interest from a couple of people. After dinner the talk around visualisation reduced to (or built up to depending on how you look at it) rendering uncertainity both in observations and model output data. Making graphs with regression for my thesis, this has been a common request from my supervisor, I respond to it with error bars and regression confidence interval curves. How does this propagate to a resonable metaphor in worldwind without making every icon hairy with error-bars ? The kml support in WorldWind seems to have also encouraged people to test what can be best described as Google Earth compatibility, leading to these hairy images.