PSNR 24.3 dB · SSIM 0.985 — near-lossless 3D reconstruction from a phone camera alone, no LiDAR or depth sensors required.
ReconStructAI3D turns 15–32 photos of an object — taken with a regular smartphone camera — into a textured 3D mesh accurate enough to evaluate against ground-truth depth at SSIM 0.985.
The trick: Segment Anything (SAM) removes background clutter before COLMAP runs Structure-from-Motion. Without this masking step, COLMAP silently produces false-positive feature matches against background noise, and the entire dense reconstruction stage degrades into garbage. Adding SAM masking eliminated this failure mode completely — that debugging insight is the core of why this pipeline actually works.
``` [Smartphone images] ↓ [SAM segmentation] ← removes background clutter ↓ [COLMAP SfM] ← sparse 3D point cloud + camera poses ↓ [OpenMVS Densify] ← dense point cloud ↓ [OpenMVS Mesh] ← surface reconstruction + refinement ↓ [OpenMVS Texture] ← photo-realistic texturing ↓ [Evaluation: PSNR/SSIM vs ground-truth depth] ```
| Scene | PSNR | SSIM | Reconstruction time |
|---|---|---|---|
| Chair | 24.3 dB | 0.985 | ~45 min |
| Monkey figurine | 24.7 dB | 0.987 | ~45 min |
Stack: SAM · COLMAP · OpenMVS · OpenCV · Open3D · Python
images/ ➝ masks/ ➝ COLMAP (sparse) ➝ OpenMVS (dense + mesh) ➝ evaluation.py ➝ PSNR/SSIM
This project performs 3D reconstruction of real-world objects using COLMAP + OpenMVS along with automated segmentation via Segment Anything (SAM). Below is the step-by-step pipeline to reproduce the results:
Capture multiple images of an object (e.g., a chair or monkey figurine) from different angles (360 degree) using a phone camera, ~20–40 photos of your object (e.g., a statue or furniture) in 360° using a smartphone.
Place them in data folder.
Run the following script to auto-generate binary masks for all images using Segment Anything (SAM):
python scripts/Mask_Generation/processMask.py
This would create:
- data/Chair/mask_out/
- data/Monkey/mask_monkey/
Note:
The pre-trained weights for SAM (e.g., sam_vit_h_4b8939.pth) are not included in this repository due to licensing restrictions.
Please download the appropriate weights manually from the official SAM repository and place them in scripts/Mask_Generation/weights/
Use COLMAP to generate the sparse 3D point cloud from your input images and SAM-generated masks.
Note: COLMAP must be installed and configured (either system-wide or via Docker). Masks should be in the same folder as the images or referenced correctly in your database setup.
You can launch COLMAP either via GUI or command-line:
colmap gui.
Steps: 1. Create a new project. 2. Import images and masks. 3. Run Feature Extraction. 4. Run Feature Matching. 5. Run Sparse Reconstruction (Mapper). 6. Export the sparse model.
Run the following COLMAP commands step-by-step (for automation):
# Feature extraction
colmap feature_extractor \
--database_path data/Chair/colmap/database.db \
--image_path data/Chair/images \
--mask_path data/Chair/mask_out \
--ImageReader.single_camera 1
# Feature matching
colmap exhaustive_matcher \
--database_path data/Chair/colmap/database.db
# Sparse reconstruction
colmap mapper \
--database_path data/Chair/colmap/database.db \
--image_path data/Chair/images \
--output_path data/Chair/colmap/sparse
I observed an important thing that was ensuring that image camera parameters are correctly embedded or set before mapping.
You would be able to see something like below:

After generating the sparse point cloud with COLMAP, convert it and continue the pipeline using OpenMVS for dense reconstruction, mesh generation, and texturing.
Requirement: OpenMVS must be installed and accessible from your terminal.
InterfaceCOLMAP \
-i sparse/0/ \
-o scene.mvs \
--images-path images/
DensifyPointCloud \
scene.mvs \
--resolution-level 1
ReconstructMesh \
scene_dense.mvs
RefineMesh \
scene_dense_mesh.mvs
TextureMesh \
scene_dense_mesh_refine.mvs
Below is the example of final textured image
Output: A textured 3D mesh of your object scene saved in .obj or .ply format.
Use MeshLab to visualize or export the final textured model.
We evaluate the visual fidelity of the reconstructed 3D models by comparing rendered outputs to reference images using PSNR (Peak Signal-to-Noise Ratio) and SSIM (Structural Similarity Index).
Organize the folder with ground truth images and the reconstructed files in a folder
python scripts/evaluation.py
Output: • A CSV file: depth_metrics.csv containing PSNR and SSIM scores for each scene (e.g., chair here). • A plotted graph below shows side-by-side metrics and visualizations.
In our test case (Chair), we achieved:
- PSNR: ~24.3 dB
- SSIM: ~0.985
These results indicate high structural similarity and decent texture fidelity between the reconstructed and ground-truth imagery.
Install dependencies:
pip install -r requirements.txt
- SAM: Meta AI – Segment Anything https://github.com/facebookresearch/segment-anything
- COLMAP: ETH Zurich – COLMAP GitHub https://github.com/colmap/colmap
- OpenMVS: Open Multi-View Stereo Library https://github.com/cdcseacave/openMVS
This project is for academic/research demonstration purposes only. SAM weights are not redistributed — due to original licenses.

