Showing posts with label otb. Show all posts
Showing posts with label otb. Show all posts

Thursday, September 15, 2011

ESA SOCIS - Coding in the Space Space

The summer of code pattern seems to have become rather popular, pity it is a mis-nomer for us Southern hemisphere folk, that's what you get for the earth being top heavy in landmass ( whoever decided they are on top anyway).

This year the European Space Agency (ESA) is running an SOC event, the catch line being a slight variant of the Copenhagen Interpretation. The two projects I am associated with are:
  1. Orfeo Toolbox SAR Interferometry support - This one is academically of most interest to me, there have been several attempts to develop the interferometry chain in open source, but they have not been properly software engineered, have dubious licensing or other shortcomings. More on this project and the teething issues encountered later.
  2. iGlobe NetCDF support enhancements - This one is professionally of most interest to me. Patrick at NASA recently put us (CSIRO) together with NOAA, NASA and ORNL to build and application tying NetCDF to WorldWind. We are planning to explore large data visualisation techniques and get best possible performance and accuracy. As well as include some analysis capability. The project is code named iGlobe.


These projects will bring my student supervision quota up-to 5 for this year, I have only had them for 3 months and there has been a huge amount work delivered. I wish I had this kind of free labour and velocity at the real workplace.

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.

Wednesday, August 11, 2010

Writing PhD thesis and living in a hole

I have finally moved house to a crummy student digs to go with the PhD writing mood. Most of my time is spent with WinEdt and latex syntax. I might think of switching allegiance to LyX since Bibus has added Lyx support, I wonder if it will mangle my tex files into LyX specific format.

I have also been doing some TerraSAR-X quad-pol data analysis and comparing decomposition results to dual-pol case. There is a very nice overlap, but some things seem more coherent when the cross-pol scattering is not taken into account - in my case tree trunks standing on water.


I did manage to sneak in some time for open-source and check out the great work Manuel is doing to incorporate Monteverdi support into Qgis. Monteverdi can pull the layers from Qgis open files list and process them. The results currently cannot be passed directly from Monteverdi into Qgis. This issue can be solved by using a custom otbprovider which pushes Monteverdi streams into the QGis view by producing an appropriate QImage.

We have also been wondering whether an application is running inside our outside a NAT, what would be the best way to check this. Say ping an external server outside the NAT and see which source address the request came from, if the source is one particular IP (we have a static IP) then we are inside NAT and need to use internal IP's to connect to certain servers, otherwise we are outside and public IP is fine.

Friday, July 30, 2010

Getting the code out - from Academic to Open Source

I am at the IGARSS conference in Waikiki , Hawaii. It has been a busy few days. All done with my presentations today, 2 posters side-by-side are rather easy to handle. The last presentation I attended today was from Eric Pottier on PolsarPro - a very brave attempt to get academic research in polarimetric SAR processing to the non-specialist user community. He mentioned that new routines and improvements get incorporated into the platform every week, so I naturally asked about the release schedule and possible version control access. This is where the academic heritage showed up, the project in-spite of its research brilliance does not have a hard working software engineer to smooth the getting it out there process. Collation of the work from the various developers and building the final release is done manually it seems.

The folks at Rennes 1 should take a leaf out of the OTB (or even RAT) book and make collaboration easier. In the recent release the simulator that I frequently use is broken and I can't report a bug or track the changes that broke it - version control please.

PS: I created a version control for myself , only for PolSARProSim.

Sunday, July 11, 2010

Compiling OTB with CUDA - on Windows 7

I discussed some OTB-CUDA experiments that had been done with Emmanuel. The experiments tell the age old story of bandwidth pay-off versus speed. If your problem is too simple the performance gain from CUDA is not going to be much, they did one of the first tests with specifically Remote Sensing type computations of various complexity. Amdahl's law is fairly intuitive and even embarassingly parallel problems that we encounter in raster processing can not break the curse of sequential segments.

In GPGPU computing one of the core tweaks is in the kernel size and computational complexity. You don't want to be performing CPU to GPU transfers all the time for the GPU to perform a very simple operation no matter however fast, on the other hand GPU's are rather constrained in the complexity of operations they can carry out and will always need assitance from the CPU in loading data from the disk etc.

The OTB GPGPU experiment had not been extensively tested on Windows, so I decided to compile it with latest offering from Microsoft - MSVC Express 2010. As penalty for being on the bleeding edge Nvidia CUDA and OpenCL don't work on 2010, so I had to time warp back to 2008. Even then the OTB-CUDA code needs some porting due to missing timing code, may be the sample here will provide some inspiration.

Saturday, June 12, 2010

Impulse shopping in Singapore and the PC Show

After 4 hectic days in Jakarta I came into Singapore and checked into the Park Royal on Kitchener road near Little India for some much needed R&R. Before I got there I had to negotiate some pretty nasty taxi queue and rush hour Jakarta traffic.

The hotel was quite nice the last time, but this time it was very very full and they put me in a room with a leaking bathroom. I wonder if social media bad mouthing can earn me a free night. It got patched up after a few rounds from housekeeping.

Emmanuel is my local events guide for Singapore. On his recommendation I went to the PC show in Suntec. Technology temptations are hard to resist, I got lured into buying an eeePC Sea Shell series ( blogging from it now), a Prolink USB HSUPA Modem, some SD cards, a Dlink wireless camera with iPhone interface and a 2.4Ghz raw mode wireless video camera.

The raw video camera is quite small and light but it produces composite video instead of IP based video streams. Some culinary experimentation followed. Eventually I ended up at Emmanuel's place. The discussion centred around adding multi-resolution and tile based processing in OTB-Monteverdi to produce something similar to Imagelinker that Ossim has with more functions from OTB's ITK heritage. The design needs to be finalized but some interesting features will be chain serialization similar to ossim specification files, unified filter interface allowing visual chain editing, a plugin architecture allowing dynamic component loading. Orfeo already includes all of ossim code, it will be a matter of placing appropriate calls and establishing a filter signature - lots of boring facade coding in the horizon.

Thursday, May 20, 2010

Toasted motors and KNN classifiers

More proof that I should stop obsessing on the Quadcopter and focus on my PhD and possibly Orfeo Toolbox. I am just getting started with the risks in playing with real life hardware. Today we ran our 5000kV motor at full-throttle for a few seconds - under careful supervision of the folks in the electromechanical lab. The motor overheated and burnt out producing a lot of heat, smoke and molten solder . The wires heated so much the joints melted, cutting off power before anything actually caught fire. I can explain this away in terms of lack of adequate thermal overload protection. In what looked like a wind tunnel test - the motor kept running while producing smoke vortices underneath, I was typing 'h' away at my arduino console to make it go faster rather than documenting the great event.

Otherwise the workshop  has done a fantastic job putting together the frame and attaching the propellor hubs to the motors. We have 3 variants of propellors - 12x8, 8x6 and flimsy high speed low pitch helicopter ones. The next iteration will use thermistors to monitor motor temperature and cut-off when overheating is detected. LiPo charge level can also be monitored with the arduino ADC's. More code for the arduino needs to be written then. No more simple bit-bang PPM. I am also contemplating getting some lower kV rated motors to turn some of the bigger props.

On the more productive and less risky side I pulled some code published in the ITK Journal to perform KNN classification into OTB. Hope I can soon get some screenshots of KNN in action in OTB-Qgis.

Thursday, May 13, 2010

Bringing Colour to Heights - Quadcopter shopping

So the University has finally reimbursed me for all the quadcopter parts purchase and it is time to shop for new parts for the 2nd version. All the electronics are fairly affordable. The major effort will be in the control system coding, but I found this at the University - that indicates a core of expertise in 3DOF quadcopter control, just need to extend to 6DOF.

On the other hand I have got some more impetus to do a few more filters in OTB-Qgis and even a special project in Orfeo Mantis to jot things down. The easiest thing to do was hillshading from Emmanuel's code. I chose a bit over the alps to show some colours, auto-detection of min/max in data can be enabled to obtain more variety.

Sunday, May 9, 2010

SVM with multiple polygons - it is more fun together

SVM is a classic supervised classifier, but as with all such techniques the output depends on the training set provided. My initial OTB-Qgis SVM used each polygon in a shapefile as a separate training sample and was not ideal for providing extensive training data. The access to vector layer attributes via otb::Datanode makes it feasible to assign multiple polygons the same class value, there is always the fallback to 1 polygon per class if there are no attributes with the polygons. Here are some comparisons with 4 polygons and the results by using 1 polygon per class and all polygons with the same attribute being assigned to 1 class. The 1 polygon per class allows us to distinguish cultivated vegetation vs natural riparian vegetation and 2 types of rocky/bare areas. While the multiple polygons per class aggregates the vegetated areas and bare areas into 2 classes.

Wednesday, March 3, 2010

Choosing how to choose keypoints - SIFT, SURF and HARRIS

OTB Features multiple keypoint detectors for image matching purposes. I have talked about SIFT and SURF in before, I recently added the simpler Harris to the disparity map plugin. All 3 work to some extent, Harris manages to produce thousands of keypoints with default parameters and cause memory errors. Something I will definitely have to fix.

Otherwise the long awaited graphical filter connector plugin should be the one I will work on next. I have enough single plugin blocks to make a chaining tool useful. Leave me some notes on which elements you would like to see in it.

Sunday, February 7, 2010

Matching things up - SIFT Landmark matching via OTB

Orfeo Toolbox has implemented a few landmark identification techniques - SIFT and SURF. Transforms can be calculated from 2 sets of landmark points using an appropriate model. I had some trouble bringing it to Qgis, the output is just one band. The sample code needs to be extended to work with multi-band images. The in-memory representation of the match images is in double, this can cause array allocation failures. Otherwise this feature matching provides correlation free image matching for images with different dynamics - such as SAR to Optical.

Friday, November 20, 2009

Building the Orfeo Stack

Orfeo Toolbox (OTB) is a great symphony written in C++, or is it Opera ? I believe C++ in spite of its ceveats is one of the most portable langauages, a great choice for something demanding maximum output from the hardware such as an image processing application.

With inspiration from music with names such as orfeo and monteverdi, OTB puts together a fair few heavy weight projects. Not only in using them as libraries but being more than the sum of its parts. The developers also merge and maintain patched copies of these dependent projects in a mercurial repository ensuring a supported version is compiled against (a lot of the dependencies are merged from repository heads so much more recent than releases).

The dependencies are gdal, ossim, ITK, FLTK , OpenThreads, expat, liblas, etc. The cmake build system with the monolithic repository containing most of the other libraries makes getting up and running from a checkout relatively painless. Now I need to build the python and java bindings and try out some Qgis plugins and on demand image processing from GeoServer.