# phantom0122/3d_object_reconstruction architecture

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

- Interactive diagram: https://gitdiagram.com/phantom0122/3d_object_reconstruction
- Repository: https://github.com/phantom0122/3d_object_reconstruction

## Overview

This repository implements multi-view RGB-D object reconstruction: capture and align color/depth frames, extract object point clouds, estimate pairwise poses, optimize a pose graph, and produce a combined reconstruction. Its documented registration options include SIFT, ORB, LoFTR, and point-to-plane ICP. The graph also shows the feature-matching and geometry utility layer. Some stages are documented more fully than their sampled implementation, so those links cite the README; no unsampled implementation details are assumed.

Main entry points: [`pose_graph_Feature_based.py`](https://github.com/phantom0122/3d_object_reconstruction/blob/main/pose_graph_Feature_based.py) (Feature pose graph), [`pcd_o3d`](https://github.com/phantom0122/3d_object_reconstruction/tree/main/pcd_o3d) (Object point clouds), [`SIFT.py`](https://github.com/phantom0122/3d_object_reconstruction/blob/main/SIFT.py) (SIFT matching), [`registration.py`](https://github.com/phantom0122/3d_object_reconstruction/blob/main/registration.py) (Registration methods)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["RGB-D capture"]
  node_capture_aligned["Aligned capture"]
  node_rgbd_frames[("Aligned RGB-D frames")]
end

subgraph group_clouds["Point cloud preparation"]
  node_preprocess["Object extraction<br/>[preprocess_pcd.py]"]
  node_rgbd_to_pcd["RGB-D conversion<br/>[RGBD_to_pcd.py]"]
  node_point_clouds[("Object point clouds")]
end

subgraph group_registration["Pairwise registration"]
  node_sift["SIFT matching<br/>[SIFT.py]"]
  node_orb["ORB matching<br/>[ORB.py]"]
  node_loftr["LoFTR matching<br/>[LoFTR.py]"]
  node_registration_core["Registration methods<br/>[registration.py]"]
end

subgraph group_reconstruction["Reconstruction"]
  node_feature_graph["Feature pose graph"]
  node_icp_graph["ICP pose graph<br/>[pose_graph_ICP.py]"]
  node_optimized_clouds[("Reconstructed clouds")]
end

subgraph group_support["Internal support"]
  node_plot["Registration visualization<br/>[plot.py]"]
  node_utils["Geometry utilities<br/>[utils.py]"]
  node_depth_render["Cloud depth rendering<br/>[pcd_to_depth.py]"]
end

node_operator(("Operator"))
node_camera{{"RealSense camera"}}

node_operator -->|"starts capture"| node_capture_aligned
node_camera -->|"streams frames"| node_capture_aligned
node_capture_aligned -->|"saves aligned frames"| node_rgbd_frames
node_rgbd_frames -->|"provides RGB-D"| node_preprocess
node_preprocess -->|"writes clouds"| node_point_clouds
node_rgbd_frames -.->|"provides RGB-D"| node_rgbd_to_pcd
node_rgbd_to_pcd -.->|"writes cloud"| node_point_clouds
node_point_clouds -->|"registers views"| node_feature_graph
node_point_clouds -->|"registers views"| node_icp_graph
node_feature_graph -->|"calls loop closure"| node_sift
node_feature_graph -->|"selects matcher"| node_orb
node_feature_graph -->|"selects matcher"| node_loftr
node_icp_graph -->|"calls loop closure"| node_sift
node_sift -->|"uses RANSAC"| node_registration_core
node_orb -->|"uses RANSAC"| node_registration_core
node_loftr -->|"uses RANSAC"| node_registration_core
node_sift -->|"gets boundaries"| node_utils
node_orb -->|"gets boundaries"| node_utils
node_loftr -->|"gets boundaries"| node_utils
node_registration_core -->|"draws alignment"| node_plot
node_feature_graph -->|"produces reconstruction"| node_optimized_clouds
node_icp_graph -->|"produces reconstruction"| node_optimized_clouds
node_point_clouds -.->|"renders depth"| node_depth_render

click node_capture_aligned "https://github.com/phantom0122/3d_object_reconstruction/blob/main/capture_aligned_images.py"
click node_rgbd_frames "https://github.com/phantom0122/3d_object_reconstruction/tree/main/train"
click node_preprocess "https://github.com/phantom0122/3d_object_reconstruction/blob/main/preprocess_pcd.py"
click node_rgbd_to_pcd "https://github.com/phantom0122/3d_object_reconstruction/blob/main/RGBD_to_pcd.py"
click node_point_clouds "https://github.com/phantom0122/3d_object_reconstruction/tree/main/pcd_o3d"
click node_sift "https://github.com/phantom0122/3d_object_reconstruction/blob/main/SIFT.py"
click node_orb "https://github.com/phantom0122/3d_object_reconstruction/blob/main/ORB.py"
click node_loftr "https://github.com/phantom0122/3d_object_reconstruction/blob/main/LoFTR.py"
click node_registration_core "https://github.com/phantom0122/3d_object_reconstruction/blob/main/registration.py"
click node_feature_graph "https://github.com/phantom0122/3d_object_reconstruction/blob/main/pose_graph_Feature_based.py"
click node_icp_graph "https://github.com/phantom0122/3d_object_reconstruction/blob/main/pose_graph_ICP.py"
click node_optimized_clouds "https://github.com/phantom0122/3d_object_reconstruction/tree/main/results"
click node_plot "https://github.com/phantom0122/3d_object_reconstruction/blob/main/plot.py"
click node_utils "https://github.com/phantom0122/3d_object_reconstruction/blob/main/utils.py"
click node_depth_render "https://github.com/phantom0122/3d_object_reconstruction/blob/main/pcd_to_depth.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_capture_aligned,node_rgbd_frames toneBlue
class node_preprocess,node_rgbd_to_pcd,node_point_clouds toneAmber
class node_sift,node_orb,node_loftr,node_registration_core toneMint
class node_feature_graph,node_icp_graph,node_optimized_clouds toneRose
class node_plot,node_utils,node_depth_render,node_operator,node_camera toneIndigo
```

## Components

### RGB-D capture

- [Aligned capture](https://github.com/phantom0122/3d_object_reconstruction/blob/main/capture_aligned_images.py): `capture_aligned_images.py`
- [Aligned RGB-D frames](https://github.com/phantom0122/3d_object_reconstruction/tree/main/train): `train`

### Point cloud preparation

- [Object extraction](https://github.com/phantom0122/3d_object_reconstruction/blob/main/preprocess_pcd.py): `preprocess_pcd.py`
- [RGB-D conversion](https://github.com/phantom0122/3d_object_reconstruction/blob/main/RGBD_to_pcd.py): `RGBD_to_pcd.py`
- [Object point clouds](https://github.com/phantom0122/3d_object_reconstruction/tree/main/pcd_o3d): `pcd_o3d`

### Pairwise registration

- [SIFT matching](https://github.com/phantom0122/3d_object_reconstruction/blob/main/SIFT.py): `SIFT.py`
- [ORB matching](https://github.com/phantom0122/3d_object_reconstruction/blob/main/ORB.py): `ORB.py`
- [LoFTR matching](https://github.com/phantom0122/3d_object_reconstruction/blob/main/LoFTR.py): `LoFTR.py`
- [Registration methods](https://github.com/phantom0122/3d_object_reconstruction/blob/main/registration.py): `registration.py`

### Reconstruction

- [Feature pose graph](https://github.com/phantom0122/3d_object_reconstruction/blob/main/pose_graph_Feature_based.py): `pose_graph_Feature_based.py`
- [ICP pose graph](https://github.com/phantom0122/3d_object_reconstruction/blob/main/pose_graph_ICP.py): `pose_graph_ICP.py`
- [Reconstructed clouds](https://github.com/phantom0122/3d_object_reconstruction/tree/main/results): `results`

### Internal support

- [Registration visualization](https://github.com/phantom0122/3d_object_reconstruction/blob/main/plot.py): `plot.py`
- [Geometry utilities](https://github.com/phantom0122/3d_object_reconstruction/blob/main/utils.py): `utils.py`
- [Cloud depth rendering](https://github.com/phantom0122/3d_object_reconstruction/blob/main/pcd_to_depth.py): `pcd_to_depth.py`

### Other components

- **Operator**
- **RealSense camera**

## Connections

- Operator → Aligned capture: starts capture (evidence: `README.md`)
- RealSense camera → Aligned capture: streams frames (evidence: `capture_aligned_images.py`)
- Aligned capture → Aligned RGB-D frames: saves aligned frames (evidence: `README.md`)
- Aligned RGB-D frames → Object extraction: provides RGB-D (evidence: `preprocess_pcd.py`)
- Object extraction → Object point clouds: writes clouds (evidence: `preprocess_pcd.py`)
- Aligned RGB-D frames → RGB-D conversion: provides RGB-D
- RGB-D conversion → Object point clouds: writes cloud
- Object point clouds → Feature pose graph: registers views (evidence: `README.md`)
- Object point clouds → ICP pose graph: registers views (evidence: `README.md`)
- Feature pose graph → SIFT matching: calls loop closure (evidence: `pose_graph_Feature_based.py`)
- Feature pose graph → ORB matching: selects matcher (evidence: `pose_graph_Feature_based.py`)
- Feature pose graph → LoFTR matching: selects matcher (evidence: `pose_graph_Feature_based.py`)
- ICP pose graph → SIFT matching: calls loop closure (evidence: `pose_graph_ICP.py`)
- SIFT matching → Registration methods: uses RANSAC (evidence: `SIFT.py`)
- ORB matching → Registration methods: uses RANSAC (evidence: `ORB.py`)
- LoFTR matching → Registration methods: uses RANSAC (evidence: `LoFTR.py`)
- SIFT matching → Geometry utilities: gets boundaries (evidence: `SIFT.py`)
- ORB matching → Geometry utilities: gets boundaries (evidence: `ORB.py`)
- LoFTR matching → Geometry utilities: gets boundaries (evidence: `LoFTR.py`)
- Registration methods → Registration visualization: draws alignment (evidence: `registration.py`)
- Feature pose graph → Reconstructed clouds: produces reconstruction (evidence: `README.md`)
- ICP pose graph → Reconstructed clouds: produces reconstruction (evidence: `README.md`)
- Object point clouds → Cloud depth rendering: renders depth
