# cdcseacave/openmvs architecture

> Architecture diagram of the GitHub repository cdcseacave/openmvs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cdcseacave/openmvs
- Repository: https://github.com/cdcseacave/openmvs

## Overview

OpenMVS is a multi-view stereo reconstruction library and command-line toolkit. Its principal workflow takes camera poses and a sparse point cloud, densifies the reconstruction, reconstructs and refines a mesh, then textures it. The repository also provides format adapters, scene transformation, keyframe extraction, and a geometry viewer. The README documents the overall reconstruction stages; the source index confirms application-to-scene dependencies and some internal module relationships. Several capabilities are represented at their exact source paths, but their unsampled implementations are not inferred in detail.

Main entry points: [`libs/MVS/Scene.h`](https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/Scene.h) (MVS scene model), [`libs/SFM/Scene.h`](https://github.com/cdcseacave/openmvs/blob/develop/libs/SFM/Scene.h) (SfM scene and alignment), [`apps/DensifyPointCloud/DensifyPointCloud.cpp`](https://github.com/cdcseacave/openmvs/blob/develop/apps/DensifyPointCloud/DensifyPointCloud.cpp) (Densify command), [`libs/MVS/SceneDensify.cpp`](https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/SceneDensify.cpp) (Dense point cloud)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sfm["SfM support"]
  node_sfm["SfM scene and alignment<br/>[Scene.h]"]
  node_rotation["Rotation averaging"]
  node_keyframes["Keyframe extraction"]
  node_sfm_import["SfM format imports<br/>[ImportCOLMAP.cpp]"]
end

subgraph group_formats["Formats and scenes"]
  node_adapters["Format adapters"]
  node_mvs_scene["MVS scene model<br/>[Scene.h]"]
  node_image_io["Image and geometry I/O<br/>[Common.h]"]
end

subgraph group_reconstruction["MVS reconstruction"]
  node_densify["Dense point cloud<br/>[SceneDensify.cpp]"]
  node_depth["Depth maps<br/>[DepthMap.cpp]"]
  node_mesh["Mesh reconstruction"]
  node_refine["Mesh refinement<br/>[SceneRefine.cpp]"]
  node_texture["Mesh texturing<br/>[SceneTexture.cpp]"]
end

subgraph group_tools["User tools"]
  node_dense_app["Densify command"]
  node_mesh_app["Mesh reconstruction command"]
  node_refine_app["Mesh refinement command<br/>[RefineMesh.cpp]"]
  node_texture_app["Texture command<br/>[TextureMesh.cpp]"]
  node_transform["Scene transformation<br/>[TransformScene.cpp]"]
  node_viewer["Interactive scene viewer<br/>[Window.h]"]
  node_selection["Geometry selection"]
  node_pipeline["Python pipeline<br/>[MvgMvsPipeline.py]"]
end

node_inputs(("Poses and sparse cloud"))
node_result["Textured mesh"]

node_inputs -->|"provides poses"| node_sfm
node_sfm -.->|"averages rotations"| node_rotation
node_sfm -.->|"transfers scene"| node_mvs_scene
node_sfm_import -.->|"imports models"| node_sfm
node_adapters -->|"loads or saves"| node_mvs_scene
node_mvs_scene -->|"uses formats"| node_image_io
node_mvs_scene -->|"provides input"| node_dense_app
node_dense_app -.->|"runs densification"| node_densify
node_densify -->|"computes depth maps"| node_depth
node_inputs -->|"supplies sparse data"| node_dense_app
node_densify -->|"provides dense cloud"| node_mesh_app
node_mesh_app -.->|"runs reconstruction"| node_mesh
node_mesh -->|"provides mesh"| node_refine_app
node_refine_app -.->|"runs refinement"| node_refine
node_refine -->|"provides refined mesh"| node_texture_app
node_texture_app -.->|"runs texturing"| node_texture
node_texture -->|"produces texture"| node_result
node_transform -->|"transforms scene"| node_mvs_scene
node_viewer -.->|"views geometry"| node_mvs_scene
node_viewer -->|"uses selection"| node_selection
node_pipeline -.->|"orchestrates"| node_dense_app
node_keyframes -.->|"processes images"| node_sfm

click node_sfm "https://github.com/cdcseacave/openmvs/blob/develop/libs/SFM/Scene.h"
click node_rotation "https://github.com/cdcseacave/openmvs/blob/develop/libs/SFM/GlobalRotationAveraging.cpp"
click node_keyframes "https://github.com/cdcseacave/openmvs/blob/develop/libs/SFM/KeyframeExtractor.cpp"
click node_sfm_import "https://github.com/cdcseacave/openmvs/blob/develop/libs/SFM/ImportCOLMAP.cpp"
click node_adapters "https://github.com/cdcseacave/openmvs/blob/develop/apps/InterfaceCOLMAP/InterfaceCOLMAP.cpp"
click node_mvs_scene "https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/Scene.h"
click node_image_io "https://github.com/cdcseacave/openmvs/blob/develop/libs/IO/Common.h"
click node_dense_app "https://github.com/cdcseacave/openmvs/blob/develop/apps/DensifyPointCloud/DensifyPointCloud.cpp"
click node_densify "https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/SceneDensify.cpp"
click node_depth "https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/DepthMap.cpp"
click node_mesh_app "https://github.com/cdcseacave/openmvs/blob/develop/apps/ReconstructMesh/ReconstructMesh.cpp"
click node_mesh "https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/SceneReconstruct.cpp"
click node_refine_app "https://github.com/cdcseacave/openmvs/blob/develop/apps/RefineMesh/RefineMesh.cpp"
click node_refine "https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/SceneRefine.cpp"
click node_texture_app "https://github.com/cdcseacave/openmvs/blob/develop/apps/TextureMesh/TextureMesh.cpp"
click node_texture "https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/SceneTexture.cpp"
click node_transform "https://github.com/cdcseacave/openmvs/blob/develop/apps/TransformScene/TransformScene.cpp"
click node_viewer "https://github.com/cdcseacave/openmvs/blob/develop/apps/Viewer/Window.h"
click node_selection "https://github.com/cdcseacave/openmvs/blob/develop/apps/Viewer/SelectionController.cpp"
click node_pipeline "https://github.com/cdcseacave/openmvs/blob/develop/scripts/python/MvgMvsPipeline.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sfm,node_rotation,node_keyframes,node_sfm_import toneBlue
class node_adapters,node_mvs_scene,node_image_io toneAmber
class node_densify,node_depth,node_mesh,node_refine,node_texture toneMint
class node_dense_app,node_mesh_app,node_refine_app,node_texture_app,node_transform,node_viewer,node_selection,node_pipeline toneRose
class node_inputs,node_result toneIndigo
```

## Components

### SfM support

- [SfM scene and alignment](https://github.com/cdcseacave/openmvs/blob/develop/libs/SFM/Scene.h): `libs/SFM/Scene.h`
- [Rotation averaging](https://github.com/cdcseacave/openmvs/blob/develop/libs/SFM/GlobalRotationAveraging.cpp): `libs/SFM/GlobalRotationAveraging.cpp`
- [Keyframe extraction](https://github.com/cdcseacave/openmvs/blob/develop/libs/SFM/KeyframeExtractor.cpp): `libs/SFM/KeyframeExtractor.cpp`
- [SfM format imports](https://github.com/cdcseacave/openmvs/blob/develop/libs/SFM/ImportCOLMAP.cpp): `libs/SFM/ImportCOLMAP.cpp`

### Formats and scenes

- [Format adapters](https://github.com/cdcseacave/openmvs/blob/develop/apps/InterfaceCOLMAP/InterfaceCOLMAP.cpp): `apps/InterfaceCOLMAP/InterfaceCOLMAP.cpp`
- [MVS scene model](https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/Scene.h): `libs/MVS/Scene.h`
- [Image and geometry I/O](https://github.com/cdcseacave/openmvs/blob/develop/libs/IO/Common.h): `libs/IO/Common.h`

### MVS reconstruction

- [Dense point cloud](https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/SceneDensify.cpp): `libs/MVS/SceneDensify.cpp`
- [Depth maps](https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/DepthMap.cpp): `libs/MVS/DepthMap.cpp`
- [Mesh reconstruction](https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/SceneReconstruct.cpp): `libs/MVS/SceneReconstruct.cpp`
- [Mesh refinement](https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/SceneRefine.cpp): `libs/MVS/SceneRefine.cpp`
- [Mesh texturing](https://github.com/cdcseacave/openmvs/blob/develop/libs/MVS/SceneTexture.cpp): `libs/MVS/SceneTexture.cpp`

### User tools

- [Densify command](https://github.com/cdcseacave/openmvs/blob/develop/apps/DensifyPointCloud/DensifyPointCloud.cpp): `apps/DensifyPointCloud/DensifyPointCloud.cpp`
- [Mesh reconstruction command](https://github.com/cdcseacave/openmvs/blob/develop/apps/ReconstructMesh/ReconstructMesh.cpp): `apps/ReconstructMesh/ReconstructMesh.cpp`
- [Mesh refinement command](https://github.com/cdcseacave/openmvs/blob/develop/apps/RefineMesh/RefineMesh.cpp): `apps/RefineMesh/RefineMesh.cpp`
- [Texture command](https://github.com/cdcseacave/openmvs/blob/develop/apps/TextureMesh/TextureMesh.cpp): `apps/TextureMesh/TextureMesh.cpp`
- [Scene transformation](https://github.com/cdcseacave/openmvs/blob/develop/apps/TransformScene/TransformScene.cpp): `apps/TransformScene/TransformScene.cpp`
- [Interactive scene viewer](https://github.com/cdcseacave/openmvs/blob/develop/apps/Viewer/Window.h): `apps/Viewer/Window.h`
- [Geometry selection](https://github.com/cdcseacave/openmvs/blob/develop/apps/Viewer/SelectionController.cpp): `apps/Viewer/SelectionController.cpp`
- [Python pipeline](https://github.com/cdcseacave/openmvs/blob/develop/scripts/python/MvgMvsPipeline.py): `scripts/python/MvgMvsPipeline.py`

### Other components

- **Poses and sparse cloud**
- **Textured mesh**

## Connections

- Poses and sparse cloud → SfM scene and alignment: provides poses (evidence: `README.md`)
- SfM scene and alignment → Rotation averaging: averages rotations (evidence: `libs/SFM/GlobalRotationAveraging.cpp`)
- SfM scene and alignment → MVS scene model: transfers scene
- SfM format imports → SfM scene and alignment: imports models
- Format adapters → MVS scene model: loads or saves (evidence: `apps/InterfaceCOLMAP/InterfaceCOLMAP.cpp`)
- MVS scene model → Image and geometry I/O: uses formats (evidence: `libs/IO/Common.h`)
- MVS scene model → Densify command: provides input (evidence: `apps/DensifyPointCloud/DensifyPointCloud.cpp`)
- Densify command → Dense point cloud: runs densification
- Dense point cloud → Depth maps: computes depth maps (evidence: `libs/MVS/SceneDensify.cpp`)
- Poses and sparse cloud → Densify command: supplies sparse data (evidence: `README.md`)
- Dense point cloud → Mesh reconstruction command: provides dense cloud (evidence: `README.md`)
- Mesh reconstruction command → Mesh reconstruction: runs reconstruction
- Mesh reconstruction → Mesh refinement command: provides mesh (evidence: `README.md`)
- Mesh refinement command → Mesh refinement: runs refinement
- Mesh refinement → Texture command: provides refined mesh (evidence: `README.md`)
- Texture command → Mesh texturing: runs texturing
- Mesh texturing → Textured mesh: produces texture (evidence: `README.md`)
- Scene transformation → MVS scene model: transforms scene (evidence: `apps/TransformScene/TransformScene.cpp`)
- Interactive scene viewer → MVS scene model: views geometry
- Interactive scene viewer → Geometry selection: uses selection (evidence: `apps/Viewer/Window.h`)
- Python pipeline → Densify command: orchestrates
- Keyframe extraction → SfM scene and alignment: processes images
