# cnes/cars architecture

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

- Interactive diagram: https://gitdiagram.com/cnes/cars
- Repository: https://github.com/cnes/cars

## Overview

CARS is a satellite multi-view-stereo framework that reconstructs 3D surface models from satellite imagery. Its principal workflow accepts configured sensor inputs, prepares stereo imagery and matching geometry, derives point clouds, and produces DSM outputs; optional pipeline stages support subsampling, filling, merging, formatting, and analysis. The orchestrator coordinates tiled and distributed computation, while CarsDataset represents tiled intermediate data. The README and tree establish these capabilities; sampled source excerpts are partial, so links among unsampled pipeline stages are intentionally not asserted.

Main entry points: [`cars/pipelines/default/default_pipeline.py`](https://github.com/cnes/cars/blob/master/cars/pipelines/default/default_pipeline.py) (Default pipeline), [`cars/pipelines/surface_modeling/surface_modeling.py`](https://github.com/cnes/cars/blob/master/cars/pipelines/surface_modeling/surface_modeling.py) (Surface modeling), [`cars/orchestrator/orchestrator.py`](https://github.com/cnes/cars/blob/master/cars/orchestrator/orchestrator.py) (Task orchestrator), [`cars/applications/rasterization/simple_gaussian_app.py`](https://github.com/cnes/cars/blob/master/cars/applications/rasterization/simple_gaussian_app.py) (DSM rasterization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Pipeline entry"]
  node_default["Default pipeline"]
  node_pipeline_factory["Pipeline factory<br/>[pipeline.py]"]
end

subgraph group_prep["Inputs and geometry"]
  node_input_params["Input validation"]
  node_sensor_loaders["Sensor loaders"]
  node_preprocessing["Preprocessing<br/>[preprocessing.py]"]
  node_subsampling["Subsampling<br/>[subsampling.py]"]
end

subgraph group_recon["Stereo reconstruction"]
  node_tie_points["Tie points<br/>[tie_points.py]"]
  node_grid_generation["Epipolar grids"]
  node_resampling["Image resampling"]
  node_sparse_matching["Sparse matching"]
  node_dense_matching["Dense matching"]
  node_triangulation["Triangulation"]
  node_point_refinement["Point refinement"]
  node_outlier_removal["Outlier removal<br/>[statistical_app.py]"]
end

subgraph group_products["Surface products"]
  node_surface_modeling["Surface modeling"]
  node_rasterization["DSM rasterization"]
  node_filling["DSM filling<br/>[filling.py]"]
  node_merging["DSM merging<br/>[merging.py]"]
  node_formatting["Output formatting<br/>[formatting.py]"]
  node_analysis["Product analysis<br/>[analysis.py]"]
end

subgraph group_runtime["Execution and data"]
  node_orchestrator["Task orchestrator<br/>[orchestrator.py]"]
  node_cluster["Compute cluster"]
  node_dataset[("Tiled datasets<br/>[cars_dataset.py]")]
end

node_user(("User/config"))
node_output["DSM products"]

node_user -->|"provides config"| node_default
node_default -->|"creates pipeline"| node_pipeline_factory
node_default -->|"checks inputs"| node_input_params
node_default -->|"loads sensors"| node_sensor_loaders
node_default -->|"prepares inputs"| node_preprocessing
node_default -.->|"runs optional"| node_subsampling
node_default -->|"runs stage"| node_tie_points
node_default -->|"runs resolutions"| node_surface_modeling
node_default -.->|"runs optional"| node_filling
node_default -.->|"runs optional"| node_merging
node_default -->|"formats outputs"| node_formatting
node_default -.->|"runs analysis"| node_analysis
node_surface_modeling -->|"generates grids"| node_grid_generation
node_surface_modeling -->|"resamples images"| node_resampling
node_surface_modeling -->|"matches features"| node_sparse_matching
node_surface_modeling -->|"computes disparities"| node_dense_matching
node_surface_modeling -->|"triangulates points"| node_triangulation
node_surface_modeling -->|"refines cloud"| node_point_refinement
node_surface_modeling -->|"filters cloud"| node_outlier_removal
node_surface_modeling -->|"rasterizes cloud"| node_rasterization
node_default -->|"coordinates work"| node_orchestrator
node_orchestrator -->|"dispatches tasks"| node_cluster
node_orchestrator -->|"tracks datasets"| node_dataset
node_filling -->|"writes products"| node_output
node_merging -->|"writes products"| node_output
node_formatting -->|"writes products"| node_output
node_rasterization -->|"produces tiles"| node_dataset

click node_default "https://github.com/cnes/cars/blob/master/cars/pipelines/default/default_pipeline.py"
click node_pipeline_factory "https://github.com/cnes/cars/blob/master/cars/pipelines/pipeline.py"
click node_input_params "https://github.com/cnes/cars/blob/master/cars/conf/input_parameters.py"
click node_sensor_loaders "https://github.com/cnes/cars/tree/master/cars/pipelines/parameters/sensor_loaders"
click node_preprocessing "https://github.com/cnes/cars/blob/master/cars/core/preprocessing.py"
click node_subsampling "https://github.com/cnes/cars/blob/master/cars/pipelines/subsampling/subsampling.py"
click node_tie_points "https://github.com/cnes/cars/blob/master/cars/pipelines/tie_points/tie_points.py"
click node_grid_generation "https://github.com/cnes/cars/blob/master/cars/applications/grid_generation/epipolar_grid_generation_app.py"
click node_resampling "https://github.com/cnes/cars/blob/master/cars/applications/resampling/bicubic_resampling_app.py"
click node_sparse_matching "https://github.com/cnes/cars/blob/master/cars/applications/sparse_matching/basic_sparse_matching_app.py"
click node_dense_matching "https://github.com/cnes/cars/blob/master/cars/applications/dense_matching/basic_dense_matching_app.py"
click node_triangulation "https://github.com/cnes/cars/blob/master/cars/applications/triangulation/line_of_sight_intersection_app.py"
click node_point_refinement "https://github.com/cnes/cars/blob/master/cars/applications/point_cloud_refinement/normals_guided_app.py"
click node_outlier_removal "https://github.com/cnes/cars/blob/master/cars/applications/point_cloud_outlier_removal/statistical_app.py"
click node_surface_modeling "https://github.com/cnes/cars/blob/master/cars/pipelines/surface_modeling/surface_modeling.py"
click node_rasterization "https://github.com/cnes/cars/blob/master/cars/applications/rasterization/simple_gaussian_app.py"
click node_filling "https://github.com/cnes/cars/blob/master/cars/pipelines/filling/filling.py"
click node_merging "https://github.com/cnes/cars/blob/master/cars/pipelines/merging/merging.py"
click node_formatting "https://github.com/cnes/cars/blob/master/cars/pipelines/formatting/formatting.py"
click node_analysis "https://github.com/cnes/cars/blob/master/cars/pipelines/analysis/analysis.py"
click node_orchestrator "https://github.com/cnes/cars/blob/master/cars/orchestrator/orchestrator.py"
click node_cluster "https://github.com/cnes/cars/blob/master/cars/orchestrator/cluster/abstract_cluster.py"
click node_dataset "https://github.com/cnes/cars/blob/master/cars/data_structures/cars_dataset.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_default,node_pipeline_factory,node_user toneBlue
class node_input_params,node_sensor_loaders,node_preprocessing,node_subsampling toneAmber
class node_tie_points,node_grid_generation,node_resampling,node_sparse_matching,node_dense_matching,node_triangulation,node_point_refinement,node_outlier_removal toneMint
class node_surface_modeling,node_rasterization,node_filling,node_merging,node_formatting,node_analysis toneRose
class node_orchestrator,node_cluster,node_dataset,node_output toneIndigo
```

## Components

### Pipeline entry

- [Default pipeline](https://github.com/cnes/cars/blob/master/cars/pipelines/default/default_pipeline.py): `cars/pipelines/default/default_pipeline.py`
- [Pipeline factory](https://github.com/cnes/cars/blob/master/cars/pipelines/pipeline.py): `cars/pipelines/pipeline.py`

### Inputs and geometry

- [Input validation](https://github.com/cnes/cars/blob/master/cars/conf/input_parameters.py): `cars/conf/input_parameters.py`
- [Sensor loaders](https://github.com/cnes/cars/tree/master/cars/pipelines/parameters/sensor_loaders): `cars/pipelines/parameters/sensor_loaders`
- [Preprocessing](https://github.com/cnes/cars/blob/master/cars/core/preprocessing.py): `cars/core/preprocessing.py`
- [Subsampling](https://github.com/cnes/cars/blob/master/cars/pipelines/subsampling/subsampling.py): `cars/pipelines/subsampling/subsampling.py`

### Stereo reconstruction

- [Tie points](https://github.com/cnes/cars/blob/master/cars/pipelines/tie_points/tie_points.py): `cars/pipelines/tie_points/tie_points.py`
- [Epipolar grids](https://github.com/cnes/cars/blob/master/cars/applications/grid_generation/epipolar_grid_generation_app.py): `cars/applications/grid_generation/epipolar_grid_generation_app.py`
- [Image resampling](https://github.com/cnes/cars/blob/master/cars/applications/resampling/bicubic_resampling_app.py): `cars/applications/resampling/bicubic_resampling_app.py`
- [Sparse matching](https://github.com/cnes/cars/blob/master/cars/applications/sparse_matching/basic_sparse_matching_app.py): `cars/applications/sparse_matching/basic_sparse_matching_app.py`
- [Dense matching](https://github.com/cnes/cars/blob/master/cars/applications/dense_matching/basic_dense_matching_app.py): `cars/applications/dense_matching/basic_dense_matching_app.py`
- [Triangulation](https://github.com/cnes/cars/blob/master/cars/applications/triangulation/line_of_sight_intersection_app.py): `cars/applications/triangulation/line_of_sight_intersection_app.py`
- [Point refinement](https://github.com/cnes/cars/blob/master/cars/applications/point_cloud_refinement/normals_guided_app.py): `cars/applications/point_cloud_refinement/normals_guided_app.py`
- [Outlier removal](https://github.com/cnes/cars/blob/master/cars/applications/point_cloud_outlier_removal/statistical_app.py): `cars/applications/point_cloud_outlier_removal/statistical_app.py`

### Surface products

- [Surface modeling](https://github.com/cnes/cars/blob/master/cars/pipelines/surface_modeling/surface_modeling.py): `cars/pipelines/surface_modeling/surface_modeling.py`
- [DSM rasterization](https://github.com/cnes/cars/blob/master/cars/applications/rasterization/simple_gaussian_app.py): `cars/applications/rasterization/simple_gaussian_app.py`
- [DSM filling](https://github.com/cnes/cars/blob/master/cars/pipelines/filling/filling.py): `cars/pipelines/filling/filling.py`
- [DSM merging](https://github.com/cnes/cars/blob/master/cars/pipelines/merging/merging.py): `cars/pipelines/merging/merging.py`
- [Output formatting](https://github.com/cnes/cars/blob/master/cars/pipelines/formatting/formatting.py): `cars/pipelines/formatting/formatting.py`
- [Product analysis](https://github.com/cnes/cars/blob/master/cars/pipelines/analysis/analysis.py): `cars/pipelines/analysis/analysis.py`

### Execution and data

- [Task orchestrator](https://github.com/cnes/cars/blob/master/cars/orchestrator/orchestrator.py): `cars/orchestrator/orchestrator.py`
- [Compute cluster](https://github.com/cnes/cars/blob/master/cars/orchestrator/cluster/abstract_cluster.py): `cars/orchestrator/cluster/abstract_cluster.py`
- [Tiled datasets](https://github.com/cnes/cars/blob/master/cars/data_structures/cars_dataset.py): `cars/data_structures/cars_dataset.py`

### Other components

- **User/config**
- **DSM products**

## Connections

- User/config → Default pipeline: provides config
- Default pipeline → Pipeline factory: creates pipeline
- Default pipeline → Input validation: checks inputs
- Default pipeline → Sensor loaders: loads sensors
- Default pipeline → Preprocessing: prepares inputs
- Default pipeline → Subsampling: runs optional
- Default pipeline → Tie points: runs stage
- Default pipeline → Surface modeling: runs resolutions
- Default pipeline → DSM filling: runs optional
- Default pipeline → DSM merging: runs optional
- Default pipeline → Output formatting: formats outputs
- Default pipeline → Product analysis: runs analysis
- Surface modeling → Epipolar grids: generates grids
- Surface modeling → Image resampling: resamples images
- Surface modeling → Sparse matching: matches features
- Surface modeling → Dense matching: computes disparities
- Surface modeling → Triangulation: triangulates points
- Surface modeling → Point refinement: refines cloud
- Surface modeling → Outlier removal: filters cloud
- Surface modeling → DSM rasterization: rasterizes cloud
- Default pipeline → Task orchestrator: coordinates work
- Task orchestrator → Compute cluster: dispatches tasks
- Task orchestrator → Tiled datasets: tracks datasets
- DSM filling → DSM products: writes products
- DSM merging → DSM products: writes products
- Output formatting → DSM products: writes products
- DSM rasterization → Tiled datasets: produces tiles
