This project showcases the process of converting Digital Surface Model (DSM) data into high-quality 3D mesh and point cloud outputs. The DSM image used for this process, along with the generated outputs, are displayed below.
- 1.0 VersionInitial Release '24.08.09
- 1.1 Version Zero Division Error Fixed, Empty Information Area is now filled with lowest Z level. '24.08.10
- 1.2 Version Now You can convert greyscale image, or RGB image to DSM '24.08.12
This is the target DSM image that was used to create the 3D data:
Below are the results of the 3D data creation process:
- DSM Image Processing: Converts DSM images into point clouds.
- 3D Mesh Generation: Creates 3D meshes using Poisson surface reconstruction.
- Multi-format Export: Outputs results in both
.ply
and.obj
formats. - Height Adjustment: Adjusts building heights to better match reality.
You can adjust Created 3D Object's height for purpose(Verical images etc..)
Ensure you have Python 3.x installed and the following libraries:
pip install numpy pillow open3d tqdm
-
Set Input and Output Paths: Edit the script to set the correct file paths for your DSM image input and desired output locations.
-
Run the Script:
(if you need)
pip install requirements.txt
python main.py
- View the Results: The script will generate point cloud and 3D mesh files in both
.ply
and.obj
formats, which you can open with 3D visualization software like MeshLab, Blender, or Open3D.
python main.py --input /path/to/your/DSM_image.tif --output_ply /path/to/save/output.ply --output_obj /path/to/save/output.obj
The script includes several adjustable parameters that can be tuned according to your specific needs:
-
Variable:
height_scaling_factor
-
Description: Adjusts the height (z-values) of the DSM data to better reflect the real-world heights of buildings.
-
Default:
1.5
-
Example:
height_scaling_factor = 2.0
will double the height of buildings.
- Variable:
depth
- Description: Controls the depth of the Poisson surface reconstruction. Higher values increase the level of detail.
- Default:
12
- Example:
depth=10
for less detail,depth=15
for more detail.
- Variables:
radius
,max_nn
- Description: Defines the search radius and the maximum number of nearest neighbors for normal estimation.
- Defaults:
radius=1.0
,max_nn=30
- Example:
radius=2.0
,max_nn=50
for wider and more comprehensive normal estimation.
- Variable:
density_threshold
- Description: Controls the threshold for removing low-density vertices from the mesh.
- Default:
0.01
(1% quantile) - Example:
density_threshold = 0.05
will remove more vertices, creating a cleaner but potentially less detailed mesh.
If you have any questions, suggestions, or issues, please feel free to reach out.
- Email: [email protected]
This project was created and maintained by Jaden Jang, a 4th-year undergraduate student in Civil & Environmental Engineering at Yonsei University.
This project is licensed under the MIT License - see the LICENSE file for details.