Apollo 15 Mosaic Completed

Image of the Moon with images from Apollo 15 projected onto it.Let me secretly show you a cool project I just finished. During the later missions of Apollo during the 70’s, NASA came to understand that their funding would be cut back. In attempt to extract as much science as possible from the last few missions to the Moon they increased the astronauts’ time on the surface, gave them a car, and added a science bay to the orbiting spacecraft. Inside that science bay (called SIM) were two repurposed spy cameras. One was the Apollo Metric Camera, whose 1400 images from Apollo 15 are seen projected above. Recently ASU has been digitally scanning this imagery. This has allowed me and my colleagues to be able to create a 3D model of a large section of the near side of the Moon and to create a beautifully stitched mosaic.

3D model of Tsiolkovsky CraterBesides these being pretty pictures, I’m proud to say that all of this work was created by open source software that NASA has produced and that is also currently available on GitHub. Vision Workbench and Stereo Pipeline are the two projects that have made this all possible. The process is computationally expensive and is not recreate-able at home, but a university or company with access to a cluster could easily recreate our results. So what does the process look like?

  1. Collect Imagery and Interest Points (using ipfind and ipmatch).
  2. Perform Bundle Adjustment to solve for correct location of cameras (using isis_adjust).
  3. Create 3D models from stereo pairs using correct camera models (with stereo).
  4. Create terrain-rectified imagery from original images (with orthoproject).
  5. Mosaic imagery and solve for exposure times (using PhotometryTK).
  6. Export imagery into tiles or KML (with plate2dem or image2qtree).

This long process above is not entirely documented yet and some tools have not yet been released in the binary version of Stereo Pipeline. Still, for the ambitious the tools are already there. Better yet, we’ll keep working on those tools to improve them as IRG is chock-full of ideas for new algorithms and places to apply these tools.

Installing Vision Workbench on Ubuntu

It seems everyone runs into trouble when installing Vision Workbench. Here’s a quick outline on how to get my favorite software on my second favorite platform. We’ll need to start with downloading all the dependencies through Ubuntu’s package manager called Aptitude.

sudo apt-get install build-essential automake libtool
             libboost1.42-all-dev libproj-dev git
             git-completion liblapack-dev ccache

The above command gets you most of the way. There is however one more dependency that we require. We need GDAL, which is a wonderful library for interfacing with many different file types and their geographic information. However Ubuntu only provides an old 1.6 version where Vision Workbench requires the latest and greatest 1.7.

Getting the newer version of GDAL requires an additional repo provided by UbuntuGIS. This can be achieved easily by doing the following:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal1-dev gdal-bin

If you happen to be one of my unfortunate interns (Muhawahaha) working from a laptop and stuck behind a government firewall. Here’s what Josh has to say about that:

However, if you are on the ARC-WLAN-GUEST network, port
11371 will most likely be blocked which will cause the above com-
mand (and programs like ping) to time out. If this is the case, the
First, add the line ”http://ppa.launchpad.net/ubuntugis/ubuntugis-
unstable/ubuntu lucid main” to your repository. Then, go to
the website http://wwwkeys.eu.pgp.net/ and search for the key
0x314DF160. Copy the text that appears into a local file. Then
apt-key add filename-here. Now you should be able to get the latest gdal. Run apt-get’s update and then install libgdal1-dev.
Alright! We are now ready to get Vision Workbench which as of May is available via a GitHub account. If you want the last stable version, download the source tarball from the official site. But instead I’ll show you how to download the current development code with Git. If you don’t have any plans of ever trying to modify Vision Workbench you can do the following.
git clone git://github.com/visionworkbench/visionworkbench.git

Others with ambitions of contributing back to the software will need to create a GitHub account and then proceed to fork Vision Workbench. Before you create a GitHub account, if you are unfamiliar with Git then you should read the first 2 chapters of ProGit. Proceed to GitHub and follow all the instructions until you have your ssh-keys setup. Then you’ll want to follow their instructions for how to fork a project. In the future when you want to contribute back to the group it will be performed with a pull request.

From inside your checked out copy of Vision Workbench in the first directory you’ll want to create a config.options file. In this file you’ll want to following contents.

PKG_GDAL_CPPFLAGS=`gdal-config --cflags`
PKG_GDAL_LIBS=`gdal-config --libs`

Finally you are ready to compile and install Vision Workbench.

make install

Vision Workbench is now installed in the build directory where the source code is checked out. You’ll probably want to point the environmental variable PATH to the build/bin directory.

If you still have spare cycles, you should run the test suite to find out if Vision Workbench is installed correctly. This is achieved with:

make check

You are now finished. It is now time to party.