Skip to main content

A Python Package for Tree Instance Segmentation in 3D Point Clouds.

Project description

pointtree

A Python Package for Tree Instance Segmentation in 3D Point Clouds.

pypi-image License: MIT CI coverage PyPI - Python Version

The package contains implementation of the following tree instance segmentation algorithms:

  • TreeXAlgorithm
  • CoarseToFineAlgorithm

It contains the official source code of the following papers:

Package Documentation

The documentation of our package is available here.

Project Setup

The setup of our package is described in the documentation.

How To Use the Package

The TreeXAlgorithm segments individual tree instances from point clouds of forest areas. It assumes that the input point cloud contains only terrain and vegetation points. If your data includes other objects (e.g., man-made structures), the algorithm can still be applied, but its accuracy may be reduced.

1. Creating an Algorithm Instance

To get started, create an instance of the TreeXAlgorithm class. All parameters have default values, but you can override them by passing keyword arguments to the constructor. For a complete list of parameters and their descriptions, see the documentation.

from pointtree.instance_segmentation import TreeXAlgorithm

# Optional: specify a folder for saving visualizations of intermediate results
# Note: generating visualizations slows down processing and is recommended only for small datasets
visualization_folder = "./visualizations"  # or set to None to disable

algorithm = TreeXAlgorithm(visualization_folder=visualization_folder)

2. Using Presets

We provide presets tailored to typical point cloud characteristics from different laser scanning modalities: terrestrial (TLS), and UAV-borne (ULS). These presets simplify setup for common use cases.

from pointtree.instance_segmentation import TreeXPresetTLS, TreeXPresetULS

preset = TreeXPresetTLS()  # or use TreeXPresetULS()
algorithm = TreeXAlgorithm(**preset)

3. Running the Algorithm

The algorithm requires a numpy array of shape (n_points, 3) as input, containing the xyz-coordinates of the point cloud. If available, you can also pass reflection intensity values which may improve segmentation accuracy.

The algorithm returns a tuple of three numpy arrays:

  • instance IDs: an array of instance labels (points that belong to the same tree have the same ID, points not belonging to any tree have the ID -1),
  • trunk positions: 2D coordinates of the detected tree trunks at breast height
  • trunk diameters: diameters of the detected trunks at breast height.
from pointtorch import read

# Load your point cloud (supports .txt, .csv, .las, .laz, .ply)
file_path = "./demo.laz"
point_cloud = read(file_path)

# Run the algorithm
instance_ids, trunk_positions, trunk_diameters = algorithm(
    point_cloud[["x", "y", "z"]].to_numpy(),
    intensities=point_cloud["intensity"].to_numpy(),
    point_cloud_id="test-point-cloud",  # Optional: Used for naming visualization / intermediate outputs
    crs="EPSG:4326"  # Optional: Used for georeferencing intermediate outputs
)

# Add results to the point cloud and save to a new file
point_cloud["instance_id"] = instance_ids
point_cloud.to("./demo_segmented.laz", columns=["x", "y", "z", "instance_id"])

How to Cite

If you use our code, please consider citing our papers:

@article{Burmeister_Tree_X_2025,
author = {Burmeister, Josafat-Mattias and Tockner, Andreas and Reder, Stefan and Engel, Markus and Richter, Rico and Mund, Jan-Peter and D{\"o}llner, J{\"u}rgen},
doi = {https://doi.org/10.48550/arXiv.2509.03633},
journal = {{arXiv} preprint},
title = {{treeX}: Unsupervised Tree Instance Segmentation in Dense Forest Point Clouds},
year = {2025}
}
@article{Burmeister_Tree_Instance_Segmentation_2024,
author = {Burmeister, Josafat-Mattias and Richter, Rico and Reder, Stefan and Mund, Jan-Peter and D{\"o}llner, J{\"u}rgen},
doi = {10.5194/isprs-annals-X-4-W5-2024-79-2024},
journal = {{ISPRS} Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences},
pages = {79--86},
title = {{Tree Instance Segmentation in Urban 3D Point Clouds Using a Coarse-to-Fine Algorithm Based on Semantic Segmentation}},
volume = {X-4/W5-2024},
year = {2024}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pointtree-1.0.0.tar.gz (133.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pointtree-1.0.0-cp314-cp314-win_amd64.whl (935.7 kB view details)

Uploaded CPython 3.14Windows x86-64

pointtree-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (765.7 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pointtree-1.0.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (702.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

pointtree-1.0.0-cp314-cp314-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pointtree-1.0.0-cp313-cp313-win_amd64.whl (911.0 kB view details)

Uploaded CPython 3.13Windows x86-64

pointtree-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (765.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pointtree-1.0.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (701.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

pointtree-1.0.0-cp313-cp313-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pointtree-1.0.0-cp312-cp312-win_amd64.whl (911.0 kB view details)

Uploaded CPython 3.12Windows x86-64

pointtree-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (765.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pointtree-1.0.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (701.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

pointtree-1.0.0-cp312-cp312-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pointtree-1.0.0-cp311-cp311-win_amd64.whl (908.2 kB view details)

Uploaded CPython 3.11Windows x86-64

pointtree-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (768.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pointtree-1.0.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (702.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

pointtree-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file pointtree-1.0.0.tar.gz.

File metadata

  • Download URL: pointtree-1.0.0.tar.gz
  • Upload date:
  • Size: 133.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pointtree-1.0.0.tar.gz
Algorithm Hash digest
SHA256 36fdc5233453f53471673c0838da076c59d40bcf1c14ffb348285bba06092519
MD5 0018db3b68fc1e1add731e6a2ada034d
BLAKE2b-256 c13ed727fdf6d51e030be538bff12169163aee91862018970e89ec20a589fd79

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pointtree-1.0.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 935.7 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pointtree-1.0.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 aba5ce90887ca80db3ca19a667303608d0b74752e1867d0558147a5540b529e5
MD5 7bc781db99da90fa9907651678f2865b
BLAKE2b-256 4e134b891a09baa1a88d480e10a63fc62a34875bf1c7ceb5e01567799e733b98

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 aa5bfd29dd0c066fe0c3b8c3306734713b4b79dd8622c87e7d41a64a245e6f3b
MD5 276d8a8d33def65f685bb4c40c27158b
BLAKE2b-256 7cfcdb598054480637924c6d2abf78d9fae9f11b9d99d2d5baa963f767bb7559

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b49f6e52214c9f4bd347e67f650f1cb463399f874ae972f2144c92c60d12115b
MD5 1b95250b3ea3919421b5f2d8cc745384
BLAKE2b-256 28d18f980adc4b5cf36489eb43e824a4baee4da5570ff9213d2db5c016bbe787

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ebe1b0bcd45dfeed76fae725c91e794df280059651915420c5e22b6f9e524323
MD5 ee6fc47ef4a5558c817610d8813b7663
BLAKE2b-256 4c673860dba5b2e8d573ad3e1ca47e3b50140369f915fe1170aa8a565033da9a

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pointtree-1.0.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 911.0 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pointtree-1.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1ea66b29b96c73547a498ac223490c198b3a7292e95be414d93a0e135a7acfa5
MD5 3a49ff4e1162fdd0876d3005b3bb67c6
BLAKE2b-256 0391e34e9794e87bfb4e423f1a14f7c42782c0811ded096e09f14341a5c152a4

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1710fb993fb2dd7399ce1ef4d43e00c7c24f8e7e599dc7db0cb3c43c2a33e037
MD5 0a6f4efb72550e241b4008bc8e3689aa
BLAKE2b-256 4d2461d729200b169ed9d3fc38f60db424f7d4d5291a21f866d32daf11aca85e

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6e5d9e1a86e9bd2d5969d667b6d4422e36c2b72f993f508ae1b706fa728f63c6
MD5 2268d1c3c2b813da4efbadf5f024d676
BLAKE2b-256 c0c6931bdfbf9b23833337c1359361c67d8ee38fb84a0270e99e6fc1d1720b54

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0c4c10d36ab2e7bf4e4c3ca83ad15fc1d9358e6dcaba5440903c167c18ff073c
MD5 5846f90ed33226bbbfca128bf74490b7
BLAKE2b-256 8d5d972f41477dd5f1efdedc3e9628745eab06b245177cd636dab7e4506200db

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pointtree-1.0.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 911.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pointtree-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e53b9e9d56bccd280843f0ccdc13d4a857097b20c7dd50b4aebcd428622d4dca
MD5 a05016df05ed09a6182b750415e1b68d
BLAKE2b-256 6dfe7574c3398a0bfada2ab8448a3660f060d81b7d3a2538b44ae66db18fb3f1

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c0db93173e0bcf9066cc76bcdacd2b63728149d8933a844aacdb1fdd86ba1c0c
MD5 8961e5464da1a970a011f44c64d9ca79
BLAKE2b-256 aefcaa0b73027dd18272d07c6f11b3887f8becca3e4ebb6cb7d24915d4176be4

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 48868f6fa21e190cb15831cec2e5650d0f55cb617e15fa3797639666029dc545
MD5 62d40c74e7c25bb22de82f1173847d1c
BLAKE2b-256 95f5c264edc8779b4ba46ca64fe3e6b56c7a7de7f5e08607ffb897d86b1efd59

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 646ace1868ef5596ad3e530859ce38326e032b8321c394250588533a480fa0b1
MD5 50498fa3331b57b718e37c475acf8fdf
BLAKE2b-256 6464bba7c0d7648de238dbf4b1a2b2274a6c2c6e4b1309a1e19ef8528658d26b

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pointtree-1.0.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 908.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pointtree-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 22b1f8b5fbb25b435fc30880211b9c8c5280d246616e10ba0c73ee3d3d3b4dd7
MD5 e6801d6e8e74c66fe2c9fdcbebc28782
BLAKE2b-256 c0aefe6eee90a982eceec9bbeee8d064aee22fda0021235d373f87e778aba29b

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6f4a9af6d3b5986de2315f1a9baa8f52c2e6959fddbf0dec88f7b9015dc0ef32
MD5 616e03a411ad129347801b36a13b3071
BLAKE2b-256 50b7db5138c2e4cddfa746a0dd4e558a762812342a1d221730fff68d7d693b49

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 63b8c747f41464b916c802ef1483bdb0941e13b3fcedf40b0e50955d77c18750
MD5 e6ddc16920a1b5ef533ccd8d3863438f
BLAKE2b-256 c39602e985a38ad0f393a99129e5c5d134553968a655c527a7a22438219b167a

See more details on using hashes here.

File details

Details for the file pointtree-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7b3da0250ff58185cc1d063ccbbbd7e9ba7b7ba654c2ed5314756c5e82504618
MD5 1a092afffed434e23032a2250ae687c0
BLAKE2b-256 22ffc509e492de1aa580b13dc65b87b29694272b9d05edb99dbfa1e20c3743c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page