… and paying for it.
I’m just now coming up for air after about 4 days of round the clock hacking trying to get an HDR (high dynamic range) and panorama stitching program called Hugin to run.Â This includes about 4 hours sleep.Â I have aÂ nasty habit of assaulting computer problems full force and working them til they’re fixed.Â If that takes two days, so be it.Â That tendency is why I quit writing software professionally.Â Well, one of the reasons.
Before I get into the nitty-gritty, let’s step back a moment and look at how most of us are used to getting new software.Â In windows, the procedure is more or less this:
- Go to the website and download the setup file
- Run the setup program
- Enjoy the software
- If you don’t like it or you’re finished with it, run the uninstaller
In the process of installation, the setup program might over-write system files that are needed for other programs and thus make your system unreliable but that’s another topic and issue.Â For the most part the above workflow works.Â Everything that the program needs is included in the package.Â Simple and user-friendly.Â Plus, by the time the programmer gets to the point of constructing an installation program, he usually has most of the big bugs worked out so the program almost always works.Â It may have some quirks but seldom if ever do you get something that just won’t work.
The *nix world traditionally has been different.Â In that world, programs are distributed as source code and every user has to compile the code using the C compiler that comes with *nix.Â That is beyond tricky.Â The programmer may have relied on libraries and other resources that did not come with the *nix distribution and that he had installed previously.Â Say, a library to work with TIFF or JPEG graphic files.Â The only way you the user know what is required is by trying to compile and having it fail.
Even worse is the Tower of Babel collection of slightly different *nixes.Â Berkley BSD, SysV (old), all the Linuxes, Apple’s version of BSD, etc.Â If the programmer wrote the program on a BSD system and you’re running Linux, the program will not compile nor run unless the programmer made provisions for your system.Â In short, installing a new program was a major project, sometimes taking days to accomplish.
The companies that sprung up to support Linux – Redhat and others – decided to fix this situation.Â They created installers called RPMs and DEB packages.Â Unfortunately the two are not the same so one won’t work in place of the other.Â A package is like a windows Setup program.Â It contains the binary (ready to run) program plus any support libraries and other files.Â The user downloads the package, runs the package manager against it and the program installs.Â Neat and clean most of the time.
There still remained the problem of unreliable software.Â *nix programmers have a nasty habit of taking a snapshot of their unfinished work, slapping a 0.xx revision number on it and putting it out there.Â Not as a beta but as the supposedly usable program.Â John’s software rule #1 – Stay away from Rev 0.xx software.
This situation was not about to displace microsoft from the desktop, something all *nix people badly want to to so the guys behind Ubuntu decided to improve things.Â One, they adopted a regular release schedule.Â Two, they tested and made reliable the software that is stored in their repository.Â Three, they created the repository so that users could go to one place and get reliable software.Â Four, the incorporated a GUI package manager called Synaptics that makes installing new software pretty much a point’n’click operation.
This system works superbly but it has two major problems.Â One, since by philosophy, nothing but security fixes are released between major releases, the programs in the repository are by nature, one or more years old.Â Two, users are dependent on what the repository maintainers can test and include.
What that means is that a lot of useful software is not available through the easy and reliable repository channel.Â One has the option of going outside the repository – going off the reservation, as it were – but when he does, he is sailing in uncharted waters.Â It’s like dipping your toe in the Bermuda Triangle.Â You’ll likely get swept away.
OK, so back to HDR photography.Â This is a technique that seeks to capture high dynamic range lighting situations that could not be otherwise photographed.Â Say a shaded lake against a bright sky.Â The technique (should be) simple.Â Set up your camera on manual, preferably on a tripod.Â Set the exposure to get a good shot of the foreground.Â The bright background will be blown out to white but that’s OK.Â Next, without changing the f/stop, change the shutter speed so that the bright background is properly exposed.Â One can take several shots, bracketing the exposure to ensure getting the best of each.
Back at the computer, two or more of the best shots from each exposure class are submitted to the HDR program.Â Through PFM (pure f…..g magic :-), they are combined to make one photo where everything is properly exposed.Â The algorithms involved are extremely complex and some work better than others.
This is one place where the Linux world is far ahead of the PC world.Â The HDR plugin for Photoshop, for example, tends to flatten the photo and make it look cartoonish.Â Not terribly useful.
A couple of days ago, a friend of mine (Hi Norman) turned me on to this article  and a program combo to do it.Â The combo is Enfuse, a command line HDR program and Hugin, a GUI wrapper for it.Â HDR was on my round tuit list so I was excited. (I should note that with most of the examples in that article and many HDR situations in general, a more satisfactory and much simpler solution is proper lighting.Â Fill flash goes a long way.)
I fired off Synaptics and checked the repository.Â Nothing useful.Â So I went to the Hugin website.Â No DEB package and no binaries.Â Oh sh*t.Â I decided to “step off the reservation” and install something outside the package management system (Synaptics).Â I have done it before (and did it all the time back in the SysV Unix days) so how bad could it be?Â Nearly 4 days of round the clock hacking is how bad.
I downloaded the tarball (like a Zip in the *nix world), unpacked it and started to compile.Â It wouldn’t.Â It needed libraries that I didn’t have.Â So I fetched libraries.Â It needed more.Â Fetch more libraries.Â Rinse and repeat.
Somewhere in that process I found this page .Â I won’t bore you with the details but I did everything on that page!Â I ended up with a program that would start and run but would not do anything.Â It was badly broken.
The usual practice in software development is to periodically take a known working version, package it up in a tarball or zip and put it up somewhere for download.Â This guy is lazy.Â He has you just grab whatever he’s working on at the time.Â That’s what that part about 1/4 down the page is about where he talks about fetching from the CVS.Â That’s his source code control system.
Unfortunately I got a snapshot or “build” that is broken.Â Norman was helping me with it because he has the program working on his system.Â We looked up and it was 6AM and the sun was rising.Â He mentions in passing that he got his version here .
He’s running Gentoo Linux which is different from Ubuntu so I didn’t pay much heed. A half a day later and just before I was about to give up, I decided to download his version and try it.Â It compiled and installed cleanly!Â Progress.Â Unfortunately it wouldn’t work.
That’s when Norman sent me his workflow.Â That is, the step by step procedure that he uses to do the job.Â I went with his workflow which was different than what was intuitive and it worked!Â That is, one part of the program that his workflow uses works while other parts are broken.Â *sigh*Â Unfortunately a lot of Linux software is that way.Â Hats off to the guys who take this crap, test and massage it to make it reliable and put it in the repositories.
This is getting kinda long so I’ll stop now.Â You should too unless you like reading about train wrecks.Â I’m including my Linux Log below so that those with morbid curiosity can see what I went through.Â Now to go out and take some HDR photos!
Started installing enblend and enfuse, two programs for doing panoramas and HDR blends.Â Recommended by Norman.
Enblend was in the repository but enfuse was not for some reason.Â Downloaded the sources from sourceforge.Â Sources are in /usr/local/src/enblend-enfuse-3.2.
when I ran configure, it said that it needed libtiff.Â Fetched that and stored it in /usr/local/src/ tiff-3.8.2.Â Made and installed that.Â Now configure says it needs liblcms.Â Synaptics says that it is installed but apparently configure can’t find it.Â I’m downloading the liblcms-dev package now.Â If that doesn’t do it I’ll make from the sources.
That worked.Â Now it wants libxmi.Â Getting that from the GNU download site.Â Will make from sources.
OK, have all the dependencies.Â Now make breaks on a malloc declaration error.Â It just ain’t working.Â Went to the net again and found a different package.
Same problem.Â This program appears to be made for Ubuntu Rel 8.10.
Now it wants libjpeg-devel headers.Â Those appear to be in the repository.Â Downloading.
Now it wants libpng-devel.Â In the repository.Â *sigh*
Try two.Â At this site
I found the following instructions.
First, get a lot of stuff:
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-devÂ Â liblcms1-dev libglew-dev libplot-dev libglut3-dev libopenexr-dev libxi-dev libxmu-devÂ Â Â (all one line)
For my 8.04 system, also get:
sudo apt-get install libopenexr2ldbl
Then get the sources from
(I may not have to do this)
make -f Makefile.cvs
Currently waiting for the first part to finish.
02:15.Â Download finished.Â Going to try a make with the sources I have before I hit the CVS.
IT WORKED!Â Longest compile of my life at almost an hour.Â Wow.
Onward to hugin
1. make some more libraries
sudo apt-get install cmake libopenexr-dev libboost-dev boost-build libboost-thread-dev libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl libglew-dev
2.Â Get the sources
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk/ hugin
Had to download subversion.
3. Make it
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .
This failed because it needed libpano13 or libpano12.Â IN the repository so gotten using package manager.Â Cmake worked fine after that.Â repository installed libpano12.
sudo make install
Compile failed on syntax errors (!) so I went back and got his example stable version using this command
svn co -r 2906 https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk/ hugin
Some Perl stuff that is needed.
sudo apt-get install libimage-size-perl
sudo cpan Panotools::Script
06:30Â that completed successfully.
06:45 make finished.Â hugin would not run.Â Failed with a shared library missing error.Â Went back to the top of that wiki page and started from the beginning.
sudo apt-get install build-essential autoconf automake1.9 libtool flex bison gdb
sudo apt-get install libc6-dev libgcc1
Must make libpano15.Â Apparently skipped that part before.Â The older version in the repository didn’t work.
sudo apt-get install zlib1g zlib1g-dev libpng12-dev libjpeg62-dev libtiff4-dev
sudo svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13
sudo make install
ssudo udo cmake -DCMAKE_INSTALL_PREFIX=/usr/local
sudo make install
IT WORKED!!!Â Hugin comes up
17:30.Â It didn’t work.Â Missing underlying applications.
sudo apt-get install libxml2-dev
sudo svn co https://hugin.svn.sourceforge.net/svnroot/hugin/autopano-sift-C/trunk/ autopano-sift-C
sudo cmake -DCMAKE_INSTALL_PREFIX=/usr/local .
sudo make install
Updating perl math::matrix 4
install Math::Matrix Image::Size Storable
sudo apt-get install libimage-size-perl
this does all the above perl stuff
sudo cpan Panotools::Script
sudo apt-get install libboost-dev
Attempting to install CinePaint, another HDR program.Â Using this script from the Cinepaint website.
echo ubuntu.sh – install from source on ubuntu
echo License BSD 10.18.2008 [email protected]
sudo apt-get install gcc automake g++ libfltk1.1-dev libgtk2.0-dev zlib1g-dev libjpeg62-dev libpng12-dev libtiff4-dev libopenexr-dev libxpm-dev libgutenprint-dev libgutenprintui2-dev liblcms1-dev pkg-config ftgl-dev libxmu-dev libxxf86vm-dev flex python-dev libtool
sudo make install
Program continues to crash.Â I reset defaults on the preferences->autopano to use Panomatic after fetching it.Â That made the auto align work but broke the end result.Â Only one photo file is getting passed to enfuse.Â About to give up.
22:10 I HAVE OFFICIALLY GIVEN UP ON THIS ABOMINATION
Let’s try something else.
Per the article here:
I’m downloading the sources for CinePaint that has an HDR plugin.Â This may be another adventure but at least the author supplies a make script.Â Downloading from here:
While waiting on the download, I cleaned up all the mess from the last day.Â Compressed and tarred all the sources, etc.
Download of the CinePaint finally finished.Â Sourceforge knocked down the download about every 3-4 minutes.Â Strange.
CinePaint would not compile so end of that experiment
Finished downloading and installing the version that Norman uses.Â It compiled cleanly and installed over the top of that other mess, preserving the desktop registration.
Once norm sent me his work flow it worked OK.Â It’s pissy about what you feed it but once it likes the input, it works.Â *sigh* a day and a half wasted on that mess.Â Here is his workflow.
go to the Images tab, load images, then click on “Create control
go to the Optimizer tab, click on “Optimize now”
maybe go to the Control points tab, and fix up control points
go to the Stitcher tab, and:
– change the idiotic default “Equirectangular” to the
– click on “Calculate Field of View”
– click on “Calculate Optimal Size”
– uncheck “Blended panorama”, and check “Blended
– click on “Stitch now”.