# opendronemap/odm architecture

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

- Interactive diagram: https://gitdiagram.com/opendronemap/odm
- Repository: https://github.com/opendronemap/odm

## Overview

ODM is a command-line photogrammetry toolkit: a user supplies aerial imagery (or supported video) and processing options, then ODM produces georeferenced mapping outputs. The graph follows that workflow through the documented application stages and preserves major results such as classified point clouds, textured models, orthophotos, and elevation models. The README establishes the product capabilities; source-index references and excerpts support only some internal connections. Unverified stage dispatch is shown as dashed rather than inferred as a definite call chain.

Main entry points: [`stages/odm_app.py`](https://github.com/opendronemap/odm/blob/master/stages/odm_app.py) (ODM application), [`run.py`](https://github.com/opendronemap/odm/blob/master/run.py) (CLI entry), [`stages/odm_dem.py`](https://github.com/opendronemap/odm/blob/master/stages/odm_dem.py) (Elevation models), [`opendm/dem/commands.py`](https://github.com/opendronemap/odm/blob/master/opendm/dem/commands.py) (DEM operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and orchestration"]
  node_run["CLI entry<br/>[run.py]"]
  node_app["ODM application<br/>[odm_app.py]"]
  node_dataset["Dataset preparation<br/>[dataset.py]"]
  node_video["Video extraction<br/>[video2dataset.py]"]
end

subgraph group_reconstruction["Image reconstruction"]
  node_sfm["Structure from motion<br/>[run_opensfm.py]"]
  node_splitmerge["Split and merge<br/>[splitmerge.py]"]
end

subgraph group_mapping["Mapping products"]
  node_georef["Georeferencing"]
  node_pointcloud["Point cloud processing<br/>[point_cloud.py]"]
  node_filterpoints["Point classification"]
  node_dem["Elevation models<br/>[odm_dem.py]"]
  node_demcommands["DEM operations<br/>[commands.py]"]
  node_rectify["Ground rectification<br/>[rectify.py]"]
  node_meshing["3D meshing<br/>[odm_meshing.py]"]
  node_texturing["Model texturing<br/>[mvstex.py]"]
  node_orthophoto["Orthophoto generation<br/>[odm_orthophoto.py]"]
  node_raster["Orthophoto operations<br/>[orthophoto.py]"]
  node_report["Processing report<br/>[odm_report.py]"]
end

subgraph group_runtime["Runtime support"]
  node_config["Options and configuration<br/>[config.py]"]
  node_system["Command execution<br/>[system.py]"]
  node_io["File handling<br/>[io.py]"]
end

node_user(("CLI user"))
node_photos["Aerial imagery"]
node_results["Georeferenced outputs"]

node_user -->|"invokes"| node_run
node_photos -->|"provides images"| node_dataset
node_user -->|"supplies video"| node_video
node_run -->|"starts"| node_app
node_run -->|"loads options"| node_config
node_app -.->|"prepares dataset"| node_dataset
node_app -.->|"dispatches reconstruction"| node_sfm
node_splitmerge -->|"uses SfM context"| node_sfm
node_app -.->|"dispatches georeferencing"| node_georef
node_app -.->|"dispatches classification"| node_filterpoints
node_app -.->|"dispatches DEM generation"| node_dem
node_demcommands -->|"calls rectification"| node_rectify
node_app -.->|"dispatches meshing"| node_meshing
node_app -.->|"dispatches texturing"| node_texturing
node_app -.->|"dispatches orthophoto"| node_orthophoto
node_orthophoto -->|"uses raster operations"| node_raster
node_app -.->|"dispatches reporting"| node_report
node_dem -.->|"uses DEM operations"| node_demcommands
node_app -->|"produces mapping products"| node_results
node_system -->|"uses file utilities"| node_io

click node_run "https://github.com/opendronemap/odm/blob/master/run.py"
click node_app "https://github.com/opendronemap/odm/blob/master/stages/odm_app.py"
click node_dataset "https://github.com/opendronemap/odm/blob/master/stages/dataset.py"
click node_video "https://github.com/opendronemap/odm/blob/master/opendm/video/video2dataset.py"
click node_sfm "https://github.com/opendronemap/odm/blob/master/stages/run_opensfm.py"
click node_splitmerge "https://github.com/opendronemap/odm/blob/master/stages/splitmerge.py"
click node_georef "https://github.com/opendronemap/odm/blob/master/stages/odm_georeferencing.py"
click node_pointcloud "https://github.com/opendronemap/odm/blob/master/opendm/point_cloud.py"
click node_filterpoints "https://github.com/opendronemap/odm/blob/master/stages/odm_filterpoints.py"
click node_dem "https://github.com/opendronemap/odm/blob/master/stages/odm_dem.py"
click node_demcommands "https://github.com/opendronemap/odm/blob/master/opendm/dem/commands.py"
click node_rectify "https://github.com/opendronemap/odm/blob/master/opendm/dem/ground_rectification/rectify.py"
click node_meshing "https://github.com/opendronemap/odm/blob/master/stages/odm_meshing.py"
click node_texturing "https://github.com/opendronemap/odm/blob/master/stages/mvstex.py"
click node_orthophoto "https://github.com/opendronemap/odm/blob/master/stages/odm_orthophoto.py"
click node_raster "https://github.com/opendronemap/odm/blob/master/opendm/orthophoto.py"
click node_report "https://github.com/opendronemap/odm/blob/master/stages/odm_report.py"
click node_config "https://github.com/opendronemap/odm/blob/master/opendm/config.py"
click node_system "https://github.com/opendronemap/odm/blob/master/opendm/system.py"
click node_io "https://github.com/opendronemap/odm/blob/master/opendm/io.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_run,node_app,node_dataset,node_video,node_user toneBlue
class node_sfm,node_splitmerge toneAmber
class node_georef,node_pointcloud,node_filterpoints,node_dem,node_demcommands,node_rectify,node_meshing,node_texturing,node_orthophoto,node_raster,node_report toneMint
class node_config,node_system,node_io toneRose
class node_photos,node_results toneIndigo
```

## Components

### Entry and orchestration

- [CLI entry](https://github.com/opendronemap/odm/blob/master/run.py): `run.py`
- [ODM application](https://github.com/opendronemap/odm/blob/master/stages/odm_app.py): `stages/odm_app.py`
- [Dataset preparation](https://github.com/opendronemap/odm/blob/master/stages/dataset.py): `stages/dataset.py`
- [Video extraction](https://github.com/opendronemap/odm/blob/master/opendm/video/video2dataset.py): `opendm/video/video2dataset.py`

### Image reconstruction

- [Structure from motion](https://github.com/opendronemap/odm/blob/master/stages/run_opensfm.py): `stages/run_opensfm.py`
- [Split and merge](https://github.com/opendronemap/odm/blob/master/stages/splitmerge.py): `stages/splitmerge.py`

### Mapping products

- [Georeferencing](https://github.com/opendronemap/odm/blob/master/stages/odm_georeferencing.py): `stages/odm_georeferencing.py`
- [Point cloud processing](https://github.com/opendronemap/odm/blob/master/opendm/point_cloud.py): `opendm/point_cloud.py`
- [Point classification](https://github.com/opendronemap/odm/blob/master/stages/odm_filterpoints.py): `stages/odm_filterpoints.py`
- [Elevation models](https://github.com/opendronemap/odm/blob/master/stages/odm_dem.py): `stages/odm_dem.py`
- [DEM operations](https://github.com/opendronemap/odm/blob/master/opendm/dem/commands.py): `opendm/dem/commands.py`
- [Ground rectification](https://github.com/opendronemap/odm/blob/master/opendm/dem/ground_rectification/rectify.py): `opendm/dem/ground_rectification/rectify.py`
- [3D meshing](https://github.com/opendronemap/odm/blob/master/stages/odm_meshing.py): `stages/odm_meshing.py`
- [Model texturing](https://github.com/opendronemap/odm/blob/master/stages/mvstex.py): `stages/mvstex.py`
- [Orthophoto generation](https://github.com/opendronemap/odm/blob/master/stages/odm_orthophoto.py): `stages/odm_orthophoto.py`
- [Orthophoto operations](https://github.com/opendronemap/odm/blob/master/opendm/orthophoto.py): `opendm/orthophoto.py`
- [Processing report](https://github.com/opendronemap/odm/blob/master/stages/odm_report.py): `stages/odm_report.py`

### Runtime support

- [Options and configuration](https://github.com/opendronemap/odm/blob/master/opendm/config.py): `opendm/config.py`
- [Command execution](https://github.com/opendronemap/odm/blob/master/opendm/system.py): `opendm/system.py`
- [File handling](https://github.com/opendronemap/odm/blob/master/opendm/io.py): `opendm/io.py`

### Other components

- **CLI user**
- **Aerial imagery**
- **Georeferenced outputs**

## Connections

- CLI user → CLI entry: invokes (evidence: `README.md`)
- Aerial imagery → Dataset preparation: provides images (evidence: `README.md`)
- CLI user → Video extraction: supplies video (evidence: `README.md`)
- CLI entry → ODM application: starts (evidence: `run.py`)
- CLI entry → Options and configuration: loads options (evidence: `run.py`)
- ODM application → Dataset preparation: prepares dataset
- ODM application → Structure from motion: dispatches reconstruction
- Split and merge → Structure from motion: uses SfM context (evidence: `stages/splitmerge.py`)
- ODM application → Georeferencing: dispatches georeferencing
- ODM application → Point classification: dispatches classification
- ODM application → Elevation models: dispatches DEM generation
- DEM operations → Ground rectification: calls rectification (evidence: `opendm/dem/commands.py`)
- ODM application → 3D meshing: dispatches meshing
- ODM application → Model texturing: dispatches texturing
- ODM application → Orthophoto generation: dispatches orthophoto
- Orthophoto generation → Orthophoto operations: uses raster operations (evidence: `opendm/orthophoto.py`)
- ODM application → Processing report: dispatches reporting
- Elevation models → DEM operations: uses DEM operations
- ODM application → Georeferenced outputs: produces mapping products (evidence: `README.md`)
- Command execution → File handling: uses file utilities (evidence: `opendm/system.py`)
