A complete pipeline for 3D reconstruction from photographs using COLMAP, with point cloud processing and visualization tools.
This project provides tools for:
- 3D Reconstruction: Convert a series of photographs into 3D point clouds using COLMAP
- Point Cloud Processing: Crop and filter point clouds spatially
- Visualization: Generate rotating video visualizations of 3D models
├── run-cpu.sh # COLMAP pipeline (CPU-only)
├── run-cuda.sh # COLMAP pipeline (GPU-accelerated)
├── crop_ply_spatial.py # Point cloud spatial cropping tool
├── viz_python.py # 3D visualization and video generation
├── violao/ # Example dataset (guitar reconstruction)
│ ├── images/ # Input photographs
│ ├── sparse/ # Sparse reconstruction output
│ └── dense/ # Dense reconstruction output
└── renders/ # Generated videos and visualizations
- COLMAP: Structure-from-Motion software
- GPU version recommended for faster processing
- CPU-only version supported
- FFmpeg: For video generation
pip install numpy open3d matplotlibchmod +x run-cuda.sh
./run-cuda.shchmod +x run-cpu.sh
./run-cpu.shInput: Place your photographs in violao/images/ directory
Output:
- Sparse reconstruction:
violao/sparse/ - Dense point cloud:
violao/dense/fused.ply
Crop point clouds to remove background and focus on the object of interest:
python3 crop_ply_spatial.py \
--input violao/dense/fused.ply \
--output violao/dense/cropped.ply \
--x_min -1.0 --x_max 1.0 \
--y_min -1.0 --y_max 1.0 \
--z_min -0.5 --z_max 2.0Generate rotating videos of your 3D models:
python3 viz_python.py \
--model violao/dense/cropped.ply \
--seconds 10 \
--fps 30 \
--style neon \
--out renders/out.mp4Available styles: neon, depth, ice, inferno, aurora
- Capture Photos: Take multiple overlapping photos of your subject from different angles
- Place Images: Copy photos to
violao/images/directory - Run Reconstruction: Execute
./run-cuda.shor./run-cpu.sh - Process Point Cloud: Use
crop_ply_spatial.pyto clean up the reconstruction - Generate Visualization: Create videos with
viz_python.py
Edit the shell scripts to adjust:
- Feature extraction parameters
- Matching settings
- Dense reconstruction quality
- GPU vs CPU usage
The visualization script supports multiple rendering styles and customizable parameters:
- Duration and frame rate
- Camera movement patterns
- Color schemes and lighting
- Point cloud downsampling for performance
The included violao/ directory contains an example reconstruction of a guitar (violão in Portuguese), demonstrating the complete pipeline from input photos to final 3D model.
-
Photography:
- Take 50-100+ overlapping photos
- Maintain consistent lighting
- Include the entire object from multiple angles
- Avoid reflective or transparent surfaces
-
Processing:
- Use GPU acceleration when available
- Adjust cropping bounds based on your specific object
- Experiment with different visualization styles
-
Performance:
- Large point clouds may need downsampling for video generation
- Consider using lower resolution for preview renders
This project is provided as-is for educational and research purposes.