Sunday, May 27, 2012

Content supply for Apple's venture into mapping

This suspense is killing me. Hope it will last. - Oscar Wilde

Apple put up a big fight against the Big Blue to establish itself in the market of personal computers. Now it has to put up a similar brave face to the big blue, red, yellow and green.

Apple acquires C3, now needs oblique and ground based photography to populate the world. While keeping bandwidth usage low and discretional. Apple will be requiring lots of data to populate its more detailed world and there will be rush of data acquisition coming up to create a multiple view representation of the static world.

The most interesting aspect of 3D reconstruction I find is the temporal decorrelation. We can never know all aspects of an object from multiple perspectives simultaneously without violating relativity. A fun aspect of this is the modelling of clock-towers. The reconstructed view always has slightly different times in the clock faces.

Causality is much more absolute than simultaneity, in our frame of reference we might be experiencing events such as the launch of Apple mapping platform whose cause is hidden in some future outcome. Meanwhile the suspense of seeing the big launch from the big fruit in a post-Jobs era is killing me.

Sunday, May 20, 2012

Portable Energy - from fire sticks to lithium

Last night there was a knock on my door at 3am, the flatmate wanted a flame to light his cigarette. We seem to have forgotten how to make fire without help. I have been reading Triumph of the nomads by Geoffrey Blainey. It has some interesting cultural facts regarding knowledge of energy generation.
Aboriginal fire sticks , the methods of fire making.
  1. Pulling stick over bark, fire plough or fire saw
  2. The bow-drill
  3. The percussion method with pyrites
From fire as source of energy and light we have moved on to more chemical mean, emphasizing on coal, potassium, phosphorus and sulphur. Energy currencies like adenosine tri-phosphate which our own cells prefer to use. I collected a lot of matchboxes while I was young and yesterday the TV was filled with imges of David Beckham and James Bond carrying the Olympic torch across the British Isle. We simply cannot afford to forget how fire is made or let all the fire in our immediate vicinity go out.

Then things switched over to fire steel - ferrocerium and butane, petroleum derivatives. It is still our highest energy density power source being used in most mobile power hungry equipment. Next came the more metallic solid state power sources, burning without visible flames, quietly without explosions unless overheated in certain laptops.

Battery technology has gone through several generations - lemon battery, copper-zinc, zinc-carbon, NiCad, NiMH, Fuel cells, Vanadium Pentoxide,  Silver oxide, Lithium and CSIRO made some headway into ultra-batteries by coupling super-capacitors to conventional chemical reaction systems. All involve chemistry and pushing ions up and down electrical staircases to store up energy around the nucleus. With our highly connected life-styles we are plagued by nomophobia, recharge mania. Sometimes I remember the sky is the ultimate device and carry around solar cells to transfer energy from the sky device.

We are constantly pushing electrons downhill in an effort to climb out of this gravity well of a planet we call home. Our techniques to harvest energy so far are not good enough to give us a ticket out without destroying a fair amount of our civilisation in the process. We will have to come up with something rather drastic to get out of this bind, pseudoscience or not.

Sunday, May 6, 2012

Producing Denser SiftGPU points - at the expense of time and RAM

One of the old adages I learnt doing CS was that you can not optimise everything - there is always a trade-off between speed and RAM (and sometimes accuracy). If you solve a problem faster then there will be a bigger problem that cannot be solved by your faster method. GPU computing seems to suffer from this scalability problem a fair bit mainly due to limited GPU Memory. In some cases there can also be issues with numerical stability. There is a fine line between Amdahl's law and Gustafson's law.

The latter is actually more fun since large problems have a patently real world feel. While playing around with large collection of aerial and terrestrial photography we found that SiftGPU seemed to be producing similar amount of key points no matter how big an image we threw at it and asked it operate at lower octaves to take advantage of the higher resolution. A bit of code inspection later I found the usual collection of magic numbers designed to prevent memory overflows ( if you have 60+GB RAM and some Teslas the magic numbers are too small). For posteriry here are the hard limits you can unsafely raise if your hardware can take a thrashing.

//hardware parameter,   automatically retrieved
int GlobalParam::        _texMaxDim = 12800;    //Maximum working size for SiftGPU, 3200 for packed
int    GlobalParam::        _texMaxDimGL = 16384;        //GPU texture limit
int GlobalParam::       _texMinDim = 16; //
int    GlobalParam::        _MemCapGPU = 0;
int GlobalParam::        _FitMemoryCap = 0;
int    GlobalParam::        _IsNvidia = 0;                //GPU vendor

The large aerial frames were defaulting to octave 3 silently, running them at octave 0 produced 500k SIFT features per frame (yes that is ridiculously huge, but these cameras are ridiculously good). With greater number of features you can perform sparse bundle adjustment using more restrictive angle range constraints and more accuracy.

Bundle adjusment has also had a recent boost from the release of Google Ceres library. This has been suitably adapted to allow faster solution of general multi-camera problems. Asteroids seem to be on everyone's mind.

    "... for it is now clearly shown that the orbit of a heavenly body may be determined quite nearly from good observations embracing only a few days; and this without any hypothetical assumption."
    - Carl Friedrich Gauss