# meteor0108/colorized-3d-mapping architecture

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

- Interactive diagram: https://gitdiagram.com/meteor0108/colorized-3d-mapping
- Repository: https://github.com/meteor0108/colorized-3d-mapping

## Overview

This repository is an offline multi-sensor 3D-mapping pipeline: rosbag or extracted sensor data is prepared and checked, navigation and calibration are reviewed, and LiDAR points are colorized using camera imagery. Dynamic-object removal is an optional pre-pass. The resulting map branches into classical LiDAR meshing and Gaussian Splatting reconstruction, with rendering, viewing, and depth-fusion capabilities. README descriptions establish the main stage relationships; internal helper connections are limited to those shown in the sampled source index or excerpts.

Main entry points: [`src/pipeline/step2_colorize_folder.py`](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step2_colorize_folder.py) (LiDAR-camera colorization), [`src/pipeline/step_pre1_extract_rosbag.py`](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre1_extract_rosbag.py) (Bag extraction), [`src/pipeline/step8_mesh_gaussian.py`](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step8_mesh_gaussian.py) (2DGS training and mesh), [`src/pipeline/step_pre1_extract_native.py`](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre1_extract_native.py) (Native-rate extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data preparation"]
  node_extract["Bag extraction"]
  node_native_extract["Native-rate extraction"]
  node_timestamp["Timestamp conversion"]
  node_csv_export["Topic CSV export"]
  node_validate["Dataset validation"]
  node_timestamp_viz["Timestamp visualization"]
end

subgraph group_alignment["Trajectory and color"]
  node_trajectory["Navigation views"]
  node_calibration_view["Projection and map checks"]
  node_colorize["LiDAR-camera colorization"]
  node_pgo_colorize["VGICP and PGO colorization"]
  node_dynamic_mask["Dynamic masking"]
  node_inpaint["Image inpainting"]
end

subgraph group_shared["Shared processing"]
  node_calibration["Sensor calibration<br/>[calibration.py]"]
  node_config["Configuration loading<br/>[config_loader.py]"]
  node_pointcloud["Point-cloud projection"]
  node_timestamps["Timestamp parsing"]
  node_file_manager["Sensor file matching<br/>[file_manager.py]"]
  node_vgicp["VGICP alignment<br/>[vgicp_aligner.py]"]
  node_pgo["Pose graph optimization"]
end

subgraph group_mesh["Classical mesh"]
  node_nksr_mesh["NKSR meshing<br/>[step6_mesh_nksr.py]"]
  node_poisson_mesh["Poisson meshing"]
  node_mesh_post["Mesh post-processing"]
  node_dense_mesh["Dense LiDAR meshing"]
  node_refined_mesh["Refined textured mesh"]
  node_texture_bake["GS texture baking"]
end

subgraph group_gaussian["Gaussian reconstruction"]
  node_gs_dataset["GS dataset preparation"]
  node_gs_dense["Dense GS dataset"]
  node_gs_2d["2DGS training and mesh"]
  node_backbone_2d["2DGS backbone adapter"]
  node_backbone_3d["3DGS backbone adapter"]
  node_gs_depth["Depth-supervised 3DGS"]
  node_render_video["GS video rendering"]
  node_flythrough["3DGS flythrough"]
end

node_rosbag(("ROS bag"))

node_rosbag -->|"extracts sensors"| node_extract
node_rosbag -->|"extracts native rate"| node_native_extract
node_extract -->|"checks dataset"| node_validate
node_extract -->|"reindexes timestamps"| node_timestamp
node_extract -->|"exports topics"| node_csv_export
node_extract -->|"visualizes timestamps"| node_timestamp_viz
node_validate -.->|"prepares sensor data"| node_trajectory
node_trajectory -->|"provides trajectory context"| node_colorize
node_calibration_view -->|"checks projection"| node_colorize
node_colorize -->|"supports batch alignment"| node_pgo_colorize
node_dynamic_mask -->|"masks fusion input"| node_colorize
node_inpaint -->|"supplies inpainted images"| node_colorize
node_colorize -->|"feeds LiDAR reconstruction"| node_nksr_mesh
node_colorize -->|"feeds merged point clouds"| node_poisson_mesh
node_native_extract -->|"supplies native-rate scans"| node_dense_mesh
node_poisson_mesh -.->|"supports mesh cleanup"| node_mesh_post
node_dense_mesh -->|"refines scan poses"| node_refined_mesh
node_poisson_mesh -->|"provides LiDAR geometry"| node_texture_bake
node_colorize -->|"prepares reconstruction input"| node_gs_dataset
node_native_extract -->|"supplies dense scans"| node_gs_dense
node_gs_dataset -->|"trains from dataset"| node_gs_2d
node_gs_dense -->|"provides dense dataset"| node_gs_2d
node_gs_2d -->|"uses adapter"| node_backbone_2d
node_gs_2d -->|"offers alternate depth track"| node_gs_depth
node_gs_2d -->|"renders trained model"| node_render_video
node_gs_depth -.->|"uses 3DGS rendering"| node_backbone_3d
node_backbone_3d -->|"supports flythrough"| node_flythrough
node_config -->|"builds calibration"| node_calibration
node_file_manager -->|"parses file times"| node_timestamps
node_pgo_colorize -->|"aligns scan windows"| node_vgicp
node_pgo_colorize -->|"optimizes poses"| node_pgo
node_colorize -->|"projects points"| node_pointcloud

click node_extract "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre1_extract_rosbag.py"
click node_native_extract "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre1_extract_native.py"
click node_timestamp "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre1b_timestamp_convert.py"
click node_csv_export "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre1c_rosbag_to_csv.py"
click node_validate "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre2_validate_dataset.py"
click node_timestamp_viz "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre3_timestamp_viz.py"
click node_trajectory "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step1_nav_reader_plot.py"
click node_calibration_view "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step0_projection_show.py"
click node_colorize "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step2_colorize_folder.py"
click node_pgo_colorize "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step5_colorize_vgicp_pgo.py"
click node_dynamic_mask "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre_dynmask.py"
click node_inpaint "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre_inpaint.py"
click node_calibration "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/common/calibration.py"
click node_config "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/common/config_loader.py"
click node_pointcloud "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/common/pointcloud_processor.py"
click node_timestamps "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/common/timestamp_parser.py"
click node_file_manager "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/common/file_manager.py"
click node_vgicp "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pgo/vgicp_aligner.py"
click node_pgo "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pgo/pose_graph_optimizer.py"
click node_nksr_mesh "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step6_mesh_nksr.py"
click node_poisson_mesh "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step7_mesh_poisson.py"
click node_mesh_post "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step6_mesh_post_process.py"
click node_dense_mesh "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step9_mesh_lidar_dense.py"
click node_refined_mesh "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step9b_dense_refined_textured.py"
click node_texture_bake "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step9c_texture_bake.py"
click node_gs_dataset "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step7b_prepare_gs_dataset.py"
click node_gs_dense "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step7c_prepare_gs_dense.py"
click node_gs_2d "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step8_mesh_gaussian.py"
click node_backbone_2d "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/gs_backbone_2dgs.py"
click node_backbone_3d "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/gs_backbone_3dgs.py"
click node_gs_depth "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step13_gsplat_depth.py"
click node_render_video "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step10_render_gs_video.py"
click node_flythrough "https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step11_3dgs_flythrough.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_extract,node_native_extract,node_timestamp,node_csv_export,node_validate,node_timestamp_viz toneBlue
class node_trajectory,node_calibration_view,node_colorize,node_pgo_colorize,node_dynamic_mask,node_inpaint toneAmber
class node_calibration,node_config,node_pointcloud,node_timestamps,node_file_manager,node_vgicp,node_pgo toneMint
class node_nksr_mesh,node_poisson_mesh,node_mesh_post,node_dense_mesh,node_refined_mesh,node_texture_bake toneRose
class node_gs_dataset,node_gs_dense,node_gs_2d,node_backbone_2d,node_backbone_3d,node_gs_depth,node_render_video,node_flythrough,node_rosbag toneIndigo
```

## Components

### Data preparation

- [Bag extraction](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre1_extract_rosbag.py): `src/pipeline/step_pre1_extract_rosbag.py`
- [Native-rate extraction](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre1_extract_native.py): `src/pipeline/step_pre1_extract_native.py`
- [Timestamp conversion](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre1b_timestamp_convert.py): `src/pipeline/step_pre1b_timestamp_convert.py`
- [Topic CSV export](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre1c_rosbag_to_csv.py): `src/pipeline/step_pre1c_rosbag_to_csv.py`
- [Dataset validation](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre2_validate_dataset.py): `src/pipeline/step_pre2_validate_dataset.py`
- [Timestamp visualization](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre3_timestamp_viz.py): `src/pipeline/step_pre3_timestamp_viz.py`

### Trajectory and color

- [Navigation views](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step1_nav_reader_plot.py): `src/pipeline/step1_nav_reader_plot.py`
- [Projection and map checks](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step0_projection_show.py): `src/pipeline/step0_projection_show.py`
- [LiDAR-camera colorization](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step2_colorize_folder.py): `src/pipeline/step2_colorize_folder.py`
- [VGICP and PGO colorization](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step5_colorize_vgicp_pgo.py): `src/pipeline/step5_colorize_vgicp_pgo.py`
- [Dynamic masking](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre_dynmask.py): `src/pipeline/step_pre_dynmask.py`
- [Image inpainting](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step_pre_inpaint.py): `src/pipeline/step_pre_inpaint.py`

### Shared processing

- [Sensor calibration](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/common/calibration.py): `src/common/calibration.py`
- [Configuration loading](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/common/config_loader.py): `src/common/config_loader.py`
- [Point-cloud projection](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/common/pointcloud_processor.py): `src/common/pointcloud_processor.py`
- [Timestamp parsing](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/common/timestamp_parser.py): `src/common/timestamp_parser.py`
- [Sensor file matching](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/common/file_manager.py): `src/common/file_manager.py`
- [VGICP alignment](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pgo/vgicp_aligner.py): `src/pgo/vgicp_aligner.py`
- [Pose graph optimization](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pgo/pose_graph_optimizer.py): `src/pgo/pose_graph_optimizer.py`

### Classical mesh

- [NKSR meshing](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step6_mesh_nksr.py): `src/pipeline/step6_mesh_nksr.py`
- [Poisson meshing](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step7_mesh_poisson.py): `src/pipeline/step7_mesh_poisson.py`
- [Mesh post-processing](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step6_mesh_post_process.py): `src/pipeline/step6_mesh_post_process.py`
- [Dense LiDAR meshing](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step9_mesh_lidar_dense.py): `src/pipeline/step9_mesh_lidar_dense.py`
- [Refined textured mesh](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step9b_dense_refined_textured.py): `src/pipeline/step9b_dense_refined_textured.py`
- [GS texture baking](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step9c_texture_bake.py): `src/pipeline/step9c_texture_bake.py`

### Gaussian reconstruction

- [GS dataset preparation](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step7b_prepare_gs_dataset.py): `src/pipeline/step7b_prepare_gs_dataset.py`
- [Dense GS dataset](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step7c_prepare_gs_dense.py): `src/pipeline/step7c_prepare_gs_dense.py`
- [2DGS training and mesh](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step8_mesh_gaussian.py): `src/pipeline/step8_mesh_gaussian.py`
- [2DGS backbone adapter](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/gs_backbone_2dgs.py): `src/pipeline/gs_backbone_2dgs.py`
- [3DGS backbone adapter](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/gs_backbone_3dgs.py): `src/pipeline/gs_backbone_3dgs.py`
- [Depth-supervised 3DGS](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step13_gsplat_depth.py): `src/pipeline/step13_gsplat_depth.py`
- [GS video rendering](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step10_render_gs_video.py): `src/pipeline/step10_render_gs_video.py`
- [3DGS flythrough](https://github.com/meteor0108/colorized-3d-mapping/blob/main/src/pipeline/step11_3dgs_flythrough.py): `src/pipeline/step11_3dgs_flythrough.py`

### Other components

- **ROS bag**

## Connections

- ROS bag → Bag extraction: extracts sensors
- ROS bag → Native-rate extraction: extracts native rate
- Bag extraction → Dataset validation: checks dataset
- Bag extraction → Timestamp conversion: reindexes timestamps
- Bag extraction → Topic CSV export: exports topics
- Bag extraction → Timestamp visualization: visualizes timestamps
- Dataset validation → Navigation views: prepares sensor data
- Navigation views → LiDAR-camera colorization: provides trajectory context
- Projection and map checks → LiDAR-camera colorization: checks projection
- LiDAR-camera colorization → VGICP and PGO colorization: supports batch alignment
- Dynamic masking → LiDAR-camera colorization: masks fusion input
- Image inpainting → LiDAR-camera colorization: supplies inpainted images
- LiDAR-camera colorization → NKSR meshing: feeds LiDAR reconstruction
- LiDAR-camera colorization → Poisson meshing: feeds merged point clouds
- Native-rate extraction → Dense LiDAR meshing: supplies native-rate scans
- Poisson meshing → Mesh post-processing: supports mesh cleanup
- Dense LiDAR meshing → Refined textured mesh: refines scan poses
- Poisson meshing → GS texture baking: provides LiDAR geometry
- LiDAR-camera colorization → GS dataset preparation: prepares reconstruction input
- Native-rate extraction → Dense GS dataset: supplies dense scans
- GS dataset preparation → 2DGS training and mesh: trains from dataset
- Dense GS dataset → 2DGS training and mesh: provides dense dataset
- 2DGS training and mesh → 2DGS backbone adapter: uses adapter (evidence: `src/pipeline/step8_mesh_gaussian.py`)
- 2DGS training and mesh → Depth-supervised 3DGS: offers alternate depth track
- 2DGS training and mesh → GS video rendering: renders trained model
- Depth-supervised 3DGS → 3DGS backbone adapter: uses 3DGS rendering
- 3DGS backbone adapter → 3DGS flythrough: supports flythrough
- Configuration loading → Sensor calibration: builds calibration (evidence: `src/common/calibration.py`)
- Sensor file matching → Timestamp parsing: parses file times (evidence: `src/common/file_manager.py`)
- VGICP and PGO colorization → VGICP alignment: aligns scan windows (evidence: `src/pipeline/step5_colorize_vgicp_pgo.py`)
- VGICP and PGO colorization → Pose graph optimization: optimizes poses (evidence: `src/pipeline/step5_colorize_vgicp_pgo.py`)
- LiDAR-camera colorization → Point-cloud projection: projects points (evidence: `src/common/pointcloud_processor.py`)
