This project provides tools for converting depth maps into 3D point clouds, with support for proper camera transformations and multi-view reconstruction.
single_camera_ply.py
: Converts depth maps from individual cameras into a combined point clouddist2depth.py
: Converts radial distance maps to depth mapsstereo_voxel.py
: Processes stereo image pairs for 3D reconstruction with voxelization
The project expects input files in the input
folder:
- Depth maps:
MetricDepth-VRayCam001.VRayZDepth.0021.exr
,MetricDepth-VRayCam002.VRayZDepth.0021.exr
- Color images:
MetricDepth-VRayCam0010021.png
,MetricDepth-VRayCam0020021.png
The scripts use the following camera parameters:
- Focal length: 6.0mm
- Film gate (sensor width): 14.186mm
- Camera baseline: 1.549421m
- Tilt angle: 11.0 degrees
Create and activate a Python virtual environment:
# Windows (Command Prompt)
python -m venv env
env\Scripts\activate
# Windows (PowerShell)
python -m venv env
.\env\Scripts\Activate.ps1
# Install dependencies
pip install -r requirements.txt
# Process single camera depth maps and combine into one point cloud
python single_camera_ply.py
# Convert radial distance maps to depth maps
python dist2depth.py
# Process stereo pairs with voxelization
python stereo_voxel.py
single_camera_ply.py
generatescombined_scene.ply
dist2depth.py
saves depth maps in theoutput
folderstereo_voxel.py
createsfused_point_cloud.ply
Required Python packages (specified in requirements.txt
):
- numpy
- opencv-python
- matplotlib