Feb 22, 2010

Google Earth 5 on Fedora 12: GLIBCXX_3.4.9 not found

After upgrading to Fedora 12 I decided to upgrade Google Earth to version 5 as well. Now google-earth doesn't want to start, saying the following:

./libstdc++.so.6: version `GLIBCXX_3.4.9' not found 

Note the path to libstdc++.so.6. It is not using the system one provided by the libstdc++-4.4.3-4.fc12.i686 package, instead it used one that came with Google Earth 4 and was not cleaned up during GE 5 install. The problem was really that GE 4 wasn't cleaned up at all and GE 5 was installed over it. Can't wait for Google to start shipping it as a real package. The solution is to uninstall GE 4 first by running the command below, then install GE 5.

~/.loki/installed/bin/Linux/x86/uninstall google-earth

Note: this applies to the user-installed version, although I am sure there is a similar uninstall tool when installed system-wide.

Feb 1, 2010

Hugin and autopano-sift-c

Hugin is an awesome panorama photo stitcher. It can optionally use a helper program - autopano-sift-C - to pre-align the photos into a panorama automatically. Autopano searches for common elements (called control points) between all the images and feeds them back to Hugin to put the puzzle together. Hugin works fine without it, but in that case control points need to be created manually, which can be a laborious task.

The autopano-sift-C program is not shipped with Fedora because it is patent-encumbered in the US (the SIFT algorithm it uses is patented by the University of British Columbia). It can be found, however, as an RPM package in the RPM Fusion repository.

At this time Hugin has a problem loading more than 124 images at a time when autopano-sift-C is in use. You get the following error message:

Could not execute command: autopano-sift-c

If you look in the X session errors there's this:
$ tail -2 ~/.xsession-errors
...AutoCtrlPointCreator.cpp:1a7) automatch(): Too many arguments for call to wxExecute()
...AutoCtrlPointCreator.cpp:1a8) automatch(): Try using the %s parameter in preferences
The problem is that autopano-sift-c takes the image names separately on the command line and Hugin can't pass more than 127 parameters to it (this being a limitation of the toolkit it uses). The quick and dirty solution is to use an external script to convert a file containing image filenames to parameters:
#!/bin/bash
# Change Hugin Preferences -> Autopano as follows:
# Autopano-SIFT: path to this script
# Arguments: --maxmatches %p %o %namefile
dos2unix $4
exec autopano-sift-c --align $1 $2 $3 `cat $4`

And voila! Hugin can now load and prealign very large image sets. If you have spaces in filenames then you might need to massage that last part a bit to quote each name, but otherwise this should work just fine.