# nghiaho12/open3d_truedepth_registration architecture

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

- Interactive diagram: https://gitdiagram.com/nghiaho12/open3d_truedepth_registration
- Repository: https://github.com/nghiaho12/open3d_truedepth_registration

## Overview

This is an iPhone TrueDepth 3D-scanning pipeline. The user supplies calibration, RGB and depth captures plus registration and filtering options; the application builds per-frame point clouds, aligns them into a global reconstruction, then writes a point cloud or optional mesh and can visualize results. Image decoding and projection are separated into ImageDepth, while pose-graph optimization also has a C++/pybind11 implementation. Some process3d sections were omitted, so uncertain calls to the optimizer and visualization are not asserted as verified.

Main entry points: [`lib/process3d.py`](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/process3d.py) (Scan pipeline), [`run.py`](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/run.py) (CLI options), [`lib/image_depth.py`](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/image_depth.py) (Frame point clouds), [`cpp/pose_graph.cpp`](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/cpp/pose_graph.cpp) (Pose optimization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_cli["CLI options<br/>[run.py]"]
end

subgraph group_frames["Frame processing"]
  node_frame_data["Frame point clouds<br/>[image_depth.py]"]
end

subgraph group_registration["Registration"]
  node_pipeline["Scan pipeline<br/>[process3d.py]"]
  node_alignment["Frame alignment<br/>[process3d.py]"]
  node_pose_graph["Pose optimization<br/>[pose_graph.cpp]"]
end

subgraph group_results["Reconstruction output"]
  node_global_cloud["Global point cloud<br/>[process3d.py]"]
  node_camera_view["Camera visualization<br/>[process3d.py]"]
  node_mesh["Poisson mesh<br/>[process3d.py]"]
end

node_user(("Scanner user"))
node_captures["Capture dataset"]
node_output["PLY output"]

node_user -->|"sets options"| node_cli
node_captures -->|"provides folder"| node_cli
node_cli -->|"runs"| node_pipeline
node_pipeline -->|"loads frames"| node_frame_data
node_captures -->|"provides RGB depth"| node_frame_data
node_pipeline -->|"registers frames"| node_alignment
node_pipeline -.->|"may optimize poses"| node_pose_graph
node_alignment -->|"merges frames"| node_global_cloud
node_pipeline -->|"creates cameras"| node_camera_view
node_pipeline -->|"optionally reconstructs"| node_mesh
node_global_cloud -->|"supplies points"| node_mesh
node_pipeline -->|"writes result"| node_output
node_mesh -->|"writes mesh"| node_output

click node_cli "https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/run.py"
click node_pipeline "https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/process3d.py"
click node_frame_data "https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/image_depth.py"
click node_alignment "https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/process3d.py"
click node_pose_graph "https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/cpp/pose_graph.cpp"
click node_global_cloud "https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/process3d.py"
click node_camera_view "https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/process3d.py"
click node_mesh "https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/process3d.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_cli,node_user toneBlue
class node_frame_data toneAmber
class node_pipeline,node_alignment,node_pose_graph toneMint
class node_global_cloud,node_camera_view,node_mesh toneRose
class node_captures,node_output toneIndigo
```

## Components

### Application entry

- [CLI options](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/run.py): `run.py`

### Frame processing

- [Frame point clouds](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/image_depth.py): `lib/image_depth.py`

### Registration

- [Scan pipeline](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/process3d.py): `lib/process3d.py`
- [Frame alignment](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/process3d.py): `lib/process3d.py`
- [Pose optimization](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/cpp/pose_graph.cpp): `cpp/pose_graph.cpp`

### Reconstruction output

- [Global point cloud](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/process3d.py): `lib/process3d.py`
- [Camera visualization](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/process3d.py): `lib/process3d.py`
- [Poisson mesh](https://github.com/nghiaho12/open3d_truedepth_registration/blob/main/lib/process3d.py): `lib/process3d.py`

### Other components

- **Scanner user**
- **Capture dataset**
- **PLY output**

## Connections

- Scanner user → CLI options: sets options (evidence: `run.py`)
- Capture dataset → CLI options: provides folder (evidence: `run.py`)
- CLI options → Scan pipeline: runs (evidence: `run.py`)
- Scan pipeline → Frame point clouds: loads frames (evidence: `lib/process3d.py`)
- Capture dataset → Frame point clouds: provides RGB depth (evidence: `README.md`)
- Scan pipeline → Frame alignment: registers frames (evidence: `README.md`)
- Scan pipeline → Pose optimization: may optimize poses
- Frame alignment → Global point cloud: merges frames (evidence: `lib/process3d.py`)
- Scan pipeline → Camera visualization: creates cameras (evidence: `lib/process3d.py`)
- Scan pipeline → Poisson mesh: optionally reconstructs (evidence: `lib/process3d.py`)
- Global point cloud → Poisson mesh: supplies points (evidence: `lib/process3d.py`)
- Scan pipeline → PLY output: writes result (evidence: `README.md`)
- Poisson mesh → PLY output: writes mesh (evidence: `lib/process3d.py`)
