How rohana96/sfm works
This repository is a command-line Structure-from-Motion project with two in-house reconstruction workflows and an optional COLMAP workflow. The primary workflow reconstructs a sparse 3D scene from matched views: estimate two-view geometry and triangulate, or incrementally estimate camera poses and add points. README capabilities guide the map; source excerpts support the main orchestration and numerical calls, but some documented features are not independently wired in the sampled CLI.
Main entry points: main.py Command runner · sfM.py Incremental reconstruction · colmap.py COLMAP runner · ransac.py Robust F estimation
Components 14
CLI entry
- Command runner
main.py
Two-view SfM
- Monument inputs
data/monument - Robust F estimation
src/ransac.py - Seven/eight-point F
src/compute_fundamental.py - Geometry utilities
utils.py - Essential pose selection
src/sfM_two_view.py
Incremental SfM
- Point triangulation
src/triangulate.py - Multi-view inputs
data/data_cow - Incremental reconstruction
src/sfM.py - 3D visualization
utils.py
COLMAP reconstruction
- COLMAP runner
src/colmap.py - COLMAP engine
Other components
- User
- Reconstruction outputs
out
Connections 17
- User → Command runner: selects run
- Command runner → Monument inputs: loads inputs
- Command runner → Robust F estimation: estimates F
- Robust F estimation → Seven/eight-point F: fits candidates
- Robust F estimation → Geometry utilities: scores epipolar error
- Command runner → Essential pose selection: selects pose
- Essential pose selection → Geometry utilities: decomposes E
- Essential pose selection → Point triangulation: tests candidates
- Command runner → Incremental reconstruction: runs incremental SfM
- Incremental reconstruction → Multi-view inputs: loads cameras and matches
- Incremental reconstruction → Point triangulation: triangulates point sets
- Incremental reconstruction → 3D visualization: plots point clouds
- Command runner → COLMAP runner: runs COLMAP
- COLMAP runner → COLMAP engine: extracts, matches, maps
- COLMAP runner → 3D visualization: plots reconstructed points
- 3D visualization → Reconstruction outputs: saves animations
- COLMAP runner → Reconstruction outputs: writes model