This is a Python-based tool that takes two simultaneous photos (Stereo) and calculates the 3D structure of the scene. The goal was to move beyond simple images and create a solid 3D object that can be opened, measured, and inspected in professional software like Blender or Windows 3D Viewer.
Below is the input images compared to the output:
![]()
|
|
- Stereo Image Processing: Uses OpenCV to compute depth maps from stereo image pairs.
- Point Cloud Generation: Converts depth maps into 3D point clouds by creating millions of (x, y, z) coordinate point, each with its own colour from the original photo.
- Mesh Generation: Utilises Poisson Surface Reconstruction to create a mesh from the point cloud, which can be exported as a .ply file.
- Object Usage: The resulting mesh can be imported into 3D software for further editing, measurement, or visualisation.
The final output is in a standard 3D format that can be easily used in various applications.
- Ensure you have uv installed to create a virtual environment.
- Install the required dependencies using:
uv sync- To run the full reconstruction process, use:
uv run main.py --viewTo process a custom dataset and save the output, use:
uv run main.py --data data/raw/your-dataset --out data/processed/your-dataset --viewTo visualise an existing mesh without processing new images, use:
uv run main.py --skip-run --viewuv: For creating a virtual environmentnumpyopencv-pythonopen3d
- 3D Scanning: This tool can be used to create 3D models of real-world objects, which can be useful for 3D printing, virtual reality, or digital archiving.
- Cultural Heritage: Museums and archaeologists can use this to create digital replicas of artifacts, allowing for preservation and remote access.
- Multi-Angle View - Currently, the tool generates a mesh from a single stereo pair, which provides a limited view of the object. Future work could involve capturing multiple stereo pairs from different angles to create a more complete 3D model.
- Enhanced Mesh Quality: Implementing more advanced mesh generation techniques to improve the quality and detail of the resulting mesh, as it currently has some noise.
- GPU Acceleration: Leveraging GPU processing to speed up the depth map computation and mesh generation, which can be time-consuming for high-resolution images.
- Integrate with Geographic Information Systems (GIS): Adding functionality to georeference the generated meshes for use in GIS applications, which would be beneficial for multiple fields, including ecology, archaeology, or architecture.


