Python Utilities for TLS LiDAR Scans of Trees
Project description
pyQSM: Python Utilities for TLS LiDAR Scans of Trees
pyQSM is a Python library for processing Terrestrial Laser Scanning (TLS) LiDAR point clouds and extracting information regarding tree structural traits from trees found in said scans. The library provides comprehensive tools for tree isolation, structural trait estimation, and 3D surface-reconstruction from point cloud data.
Overview
pyQSM focuses on three primary use cases:
- Tree Isolation: Separating individual trees from surrounding man-made objects and other vegetation.
- Epiphyte Segmentation: Isolating and analyzing different parts of trees (trunk, branches, leaves) as well as plants in and around the trees.
- Ray Casting Similations: Creation of 3D meshes representing objects and examining their characteristics via tensor intersection calculations.
Key Features
๐ณ Tree Processing Pipeline
- Point Cloud Preprocessing: Cleaning, filtering, and statistical outlier removal
- Tree Isolation: Advanced algorithms to separate individual trees from complex environments
- Structural Segmentation: Automatic identification of trunk, branches, and foliage components
- Skeletonization: Extract tree skeletal structure using robust Laplacian-based methods
- QSM Generation: Create quantitative structural models with cylindrical approximations
๐ง Core Algorithms
- Skeleton Extraction: Robust Laplacian-based point cloud skeletonization
- Clustering: DBSCAN and K-means clustering for point cloud segmentation
- Geometric Fitting: RANSAC-based cylinder and sphere fitting
- Tree Topology: Graph-based representation of tree structure
- Surface geometry.reconstruction: Mesh generation and processing
๐ Analysis & Visualization
- Canopy Metrics: Comprehensive tree structure analysis
- 3D Visualization: Interactive point cloud and mesh visualization using Open3D
- Color Analysis: HSV-based foliage classification and analysis
- Ray Casting: Advanced geometric analysis and projection methods
- UI Interface: GUI components for interactive data exploration
Architecture
pyQSM/
โโโ pyQSM/ # Main source code
โ โโโ geometry/ # Geometric processing modules
โ โ โโโ skeletonize.py # Skeleton/Wireframe extraction algorithms
โ โ โโโ point_cloud_processing.py # Point cloud utilities
โ โ โโโ zoom_and_filter.py # Bounded filtering utilities
โ โ โโโ mesh_processing.py # Triangle Mesh manipulation
| | โโโ reconstruction.py # 3D geometry.reconstruction tools
โ โโโ math/ # Utility functions
โ โ โโโ fit.py # RANSAC, DBSCAN, etc. clustering
โ โ โโโ math_utils.py # Basic math (i.e. finding center, percentiles)
โ โโโ utils/ # Utility functions
โ โ โโโ io.py # Input/output operations
โ โ โโโ logging_utils.py # Logging helper functions
โ โ โโโ plotting.py # Matplotlib scatter plots, histograms, etc.
โ โ โโโ lib_integration.py # External library integration
โ โโโ viz/ # Visualization modules
โ โ โโโ viz_utils.py # Open3D visualization utilities
โ โ โโโ color.py # Color analysis and mapping
โ โ โโโ tables.py # for outputing tabular data
โ โโโ tree_isolation.py # Tree isolation algorithms
โ โโโ qsm_generation.py # QSM generation pipeline
โ โโโ canopy_metrics.py # Tree analysis metrics
โ โโโ ray_casting.py # Ray casting operations
โโโ scripts/ # Processing scripts and workflows
โโโ data/ # Data storage and examples
โโโ requirements.txt # Dependencies
Installation
Prerequisites
- Python 3.8+
- CUDA support (optional, for GPU acceleration)
Dependencies
pip install -r requirements.txt
Key dependencies include:
open3d- 3D data processingnumpy- Numerical computingscipy- Scientific computingmatplotlib- Plotting and visualizationnetworkx- Graph processingscikit-learn- Machine learning algorithmspolyscope- 3D visualizationrobust_laplacian- Laplacian mesh processing
Configuration
The library uses TOML configuration files for algorithm parameters:
src/pyqsm_config.toml- Main configuration file- Environment variables:
PY_QSM_CONFIG,PY_QSM_LOG_CONFIG
Configuration
Algorithm parameters can be customized in pyqsm_config.toml:
[skeletonize]
moll = 1e-6
n_neighbors = 20
max_iter = 20
init_contraction = 7
init_attraction = 1
[dbscan]
epsilon = 0.1
min_neighbors = 10
[sphere]
min_radius = 0.01
max_radius = 1.5
Processing Scripts
The scripts/ directory contains ready-to-use processing workflows:
tree_isolation_script.py- Complete tree isolation pipelinetree_iso_from_feature_branch.py- Feature-based tree isolationvisualize_o3d_ml.py- Machine learning-based visualization
Research Applications
pyQSM is designed for:
-
Tree Canopy Segmentation: Automated identification of individual trees and epipytes there-in
-
Environmental Simulation: Triangle meshes can be used along side ray-casting to simulate different angles of sunlight, cloud cover and rain angle
License
This project is licensed under the Mozilla Public License Version 2.0. See LICENSE for details.
Citation
If you use pyQSM in your research, please cite:
[Publication details to be added when available]
Support
For questions, issues, or contributions:
- Open an issue on GitHub
- Check the documentation in the
data/notes/directory - Review example workflows in the
scripts/directory
Note: This library is under active development. Features and APIs may change between versions. Please check the changelog for breaking changes and updates.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyqsm-0.1.0.tar.gz.
File metadata
- Download URL: pyqsm-0.1.0.tar.gz
- Upload date:
- Size: 73.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0761ddeb6fe0b94c4922029c4ec72f5916870d94d269c2b78d0c5d5db2334560
|
|
| MD5 |
665f23b4a9752c271acddb442b6c6cb6
|
|
| BLAKE2b-256 |
b83e22e4673890856bc911364c5ab62f70b30a686684eb7a94aa18d7e71b99e3
|
File details
Details for the file pyqsm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyqsm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 77.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b98b2fb62b500adbca74964bd6c773caed2e716b911c5e831f62886e2876c63c
|
|
| MD5 |
428fece711576ad17789dfde287d286b
|
|
| BLAKE2b-256 |
71357448cf64ebbd432f448c317e50dce56fe23998d560309d9e83d46e41934a
|