How apburt/treeseg works
treeseg is a command-line toolkit and C++ library for extracting individual trees from forest lidar point clouds, with an optional RIEGL RXP converter. The principal workflow is organized around preparing point clouds, finding stems, segmenting stems, constructing crown volumes, and segmenting crowns; wood/leaf classification and cloud utilities are additional capabilities. The sampled sources show individual command behavior and calls into the shared library, but not a central workflow orchestrator, so links between separate commands are left unasserted. Some documented tutorial capabilities are represented by their source commands where available.
Main entry points: treeseg.cpp Point-cloud algorithms · sepwoodleaf.cpp Wood leaf command · rxp2pcd.cpp RXP conversion · downsample.cpp Downsampling
Components 21
Cloud preparation
- RXP conversion
src/rxp2pcd.cpp - Downsampling
src/downsample.cpp - Cloud thinning
src/thin.cpp - DTM slicing
src/getdtmslice.cpp - Nearest-neighbour tool
src/nearestneighbour.cpp - Coordinate plotting
src/plotcoords.cpp - PCD to text
src/pcdPointTreeseg2txt.cpp - XYZRGB to text
src/pcdPointXYZRGB2txt.cpp - Text to PCD
src/txtPointTreeseg2pcd.cpp - RXP tree conversion
src/rxp2tree.cpp
Tree extraction
- Stem finding
src/findstems.cpp - Stem segmentation
src/segmentstem.cpp - Crown volume
src/getcrownvolume.cpp - Crown segmentation
src/segmentcrown.cpp
Wood leaf classification
- Wood leaf command
src/sepwoodleaf.cpp - GMM classification
src/leafsep.cpp - Classification API
include/leafsep.h
Shared point-cloud core
- Point-cloud algorithms
src/treeseg.cpp - Treeseg API
include/treeseg.h - Point schema
include/treeseg_pointtype.h
Other components
- Lidar user
Connections 23
- Lidar user → RXP conversion: runs optionally
- Lidar user → Downsampling: runs tools
- Lidar user → Stem finding: runs workflow
- Lidar user → Stem segmentation: runs workflow
- Lidar user → Crown volume: runs workflow
- Lidar user → Crown segmentation: runs workflow
- Lidar user → Wood leaf command: runs optionally
- RXP conversion → Point-cloud algorithms: uses API
src/rxp2pcd.cpp - Downsampling → Point-cloud algorithms: calls algorithms
src/downsample.cpp - Cloud thinning → Point-cloud algorithms: calls algorithms
src/thin.cpp - DTM slicing → Point-cloud algorithms: calls algorithms
src/getdtmslice.cpp - Stem finding → Point-cloud algorithms: clusters and fits
src/findstems.cpp - Stem segmentation → Point-cloud algorithms: filters and segments
src/segmentstem.cpp - Crown volume → Point-cloud algorithms: measures and filters
src/getcrownvolume.cpp - Crown segmentation → Point-cloud algorithms: segments and builds
src/segmentcrown.cpp - Wood leaf command → Point-cloud algorithms: segments regions
src/sepwoodleaf.cpp - Wood leaf command → GMM classification: classifies clouds
src/sepwoodleaf.cpp - GMM classification → Classification API: implements API
include/leafsep.h - Classification API → Treeseg API: includes
include/leafsep.h - Treeseg API → Point schema: uses schema
include/treeseg.h - Nearest-neighbour tool → Point-cloud algorithms: uses API
src/nearestneighbour.cpp - PCD to text → Point-cloud algorithms: uses API
src/pcdPointTreeseg2txt.cpp - Text to PCD → Point-cloud algorithms: uses API
src/txtPointTreeseg2pcd.cpp