Photo Tourism, rebuilt
An implementation of Photo Tourism: Exploring Photo Collections in 3D (Snavely, Seitz and Szeliski, SIGGRAPH 2006), written by Frédo Durand for the book Computational Photography.
Structure from motion in Python turns a collection of photographs into cameras and a sparse point cloud. A WebGL explorer then navigates the result the way the paper does: click a camera to stand where its photograph was taken, move between photographs by the paper's geometric relations, or drag a box around something to be taken to the photograph that shows it best. A JavaScript port of the same pipeline also registers your own photographs inside the browser, without uploading them anywhere.
Try it
Unzip it, then from the phototour folder:
python3 viewer/serve.py
Open http://127.0.0.1:8130/ to explore the included scene, or
http://127.0.0.1:8130/reconstruct.html to reconstruct your own photographs in
the browser. Both need only Python 3.10 or later and a current browser.
To reconstruct with the Python pipeline, which estimates lens distortion and can use a learned matcher:
python3 -m pip install -r requirements.txt
python3 recon/build_scene.py path/to/your/photos myscene
Then open http://127.0.0.1:8130/?scene=myscene.
What is in it
recon/: features, matching, tracks, incremental reconstruction and bundle adjustment in Python, with tests against scenes whose answers are known.viewer/: the explorer, and the in-browser reconstruction, each browser stage tested against the Python it was ported from.docs/NOTES.md: the project's lab notebook, with every measurement and every approach that was tried and rejected.
Licence
The code and the documentation are under the MIT licence. The photographs in the included
scene are not: each keeps its own Creative Commons or public-domain licence, recorded with its
author and source in viewer/scenes/brandenburg/credits.json.