From:
to
Possibly not the detailed panoramic mural you were hoping for?
These images were taken using a 5cm Christmas Tree decoration and a cheap 1Mega Pixel camera that has been ripped from it's case and mounted behind a Super8 camera lens with macro settings. Perfection was not the aim of the exercise.
I have been seeing just how hard is it for a computer to recognise a horizon using just the blueness of the sky. Many learned people are doing the same but there is nothing like trying yourself.
First let's remove everything but the blue:
then normalise each spoke and do some red green rejection:
and then remap the whole thing:
.
One hopes that the purple line shows the horizon.
In each of the above images, the red line (hard to see) shows the lowest threshold level of a normalised spoke, the yellow line is a low pass filtered version of the red one, the green line is an average radius using a Fourier convolution (big words but it just means that you multiply by sine and cos for each value) giving a first approximation of the horizon. The purple line is a second approximation of the horizon by ensuring that no yellow line appears below the purple line.
I have seen dragonflies flying in this exact spot. How do they fly so smoothly with such a little brain? They probably have inertia sensors but, more importantly, they have vision into the ultraviolet spectrum (as well as the green spectrum). The following panorama was taken using an ultraviolet camera with a polished aluminium mirror:
It looks like a twilight scene but it was close to noon. The horizon is much easier to recognise as is witnessed by the purple line.
All the above images were converted using a plug-in for VirtualDub, a freeware program created by Avery Lee for the analysis, conversion, editing and adjustment of video and still images. An SDK is available to allow others, such as myself, to create C code plugins to filter the images.
I present my plugin here as polar.vdf and as source code. It was compiled to DLL using the DevC++ IDE which uses a gcc compiler. Hopefully the following source code is sufficiently commented to explain itself.
While VirtualDub plugins are supposed to supply a configuration dialog, I was changing the setup parameters too fast to worry about such things and I wanted a configuration file to travel with it's image. As such, there are a few tricks to using this filter.
Lets go step by step through what you need to do:
If you change the configuration file using a text editor, then to apply these changes, just go [Video][Filter][Polar][Configer][Okay] and move frames again.
Have a look at the example configuration file polar.cfg which is commented for your hopeful understanding.
I have discovered that other minds have thought of using christmas tree decorations. There is mention of using a christmas tree bulb at: http://www.inria.fr/rapportsactivite/RA2005/movi/uid51.html. There was also a description of how to use the mirror but the parent site has changed: http://asl.epfl.ch/~scaramuz/research/Davide_Scaramuzza_files/Research/OcamCalib_Tutorial.htm