TreeLS v1.0


Monthly downloads



Terrestrial Point Cloud Processing of Forest Data

Algorithms for tree detection, noise removal, stem modelling, 3D visualization and manipulation of terrestrial 'LiDAR' (but not only) point clouds, currently focusing on high performance applications for forest inventory - being fully compatible with the 'LAS' infrastructure provided by 'lidR'. For in depth descriptions of the stem classification and segmentation algorithms check out Conto et al. (2017) <doi:10.1016/j.compag.2017.10.019>.



High performance R functions for forest inventory based on Terrestrial Laser Scanning (but not only) point clouds.


This package is a refactor of the methods described in this paper.

The algorithms were rewritten in C++ and wrapped in R functions through Rcpp. The algorithms were reviewed and enhanced, new functionalities introduced and the rebuilt functions now work upon lidR's LAS objects infrastructure.

This is an ongoing project and new features will be introduced often. For any questions or comments please contact me through github. Suggestions, ideas and references of new algorithms are always welcome - as long as they fit into TreeLS' scope.

Main functionalities

  • Tree detection at plot level
  • Stem points detection at single tree and plot levels
  • Stem segmentation at single tree and plot levels

Coming soon:

  • lidR wrappers for writing TLS data with extra header fields
  • Eigen decomposition feature detection for trees and stems
  • Tree modelling based on robust cylinder fitting
  • 3D interactive point cloud manipulation



  • devtools: run install.packages('devtools', dependencies = TRUE) from the R console
  • Rcpp compiler:
    • on Windows: install Rtools for your R version - make sure to add it to your system's path
    • on Mac: install Xcode
    • on Linux: be sure to have r-base-dev installed

Install TreeLS latest version

On the R console, run:


Legacy code

For anyone still interested in the old implementations of this library (fully developed in R, slow but suitable for research), you can still use it. In order to do it, uninstall any recent instances of TreeLS and reinstall the legacy version:

devtools::install_github('tiagodc/TreeLS', ref='old')

Not all features from the old package were reimplemented using Rcpp, but I'll get there.


Example of full processing pipe until stem segmentation for a forest plot:


# open artificial sample file
file = system.file("extdata", "pine_plot.laz", package="TreeLS")
tls = readTLS(file)

# normalize the point cloud
tls = tlsNormalize(tls, keepGround = T)
plot(tls, color='Classification')

# extract the tree map from a thinned point cloud
thin = tlsSample(tls, voxelize(0.05))
map = treeMap(thin, map.hough(min_density = 0.03))

# visualize tree map in 2D and 3D
xymap = treePositions(map, plot = TRUE)
plot(map, color='Radii')

# classify stem points
tls = stemPoints(tls, map)

# extract measures
seg = stemSegmentation(tls, = 15))

# view the results
tlsPlot(tls, seg)
tlsPlot(tls, seg, map)

Functions in TreeLS

Name Description
tlsRotate Rotate point cloud towards a horizontal plane
stemSegmentation Stem segmentation
setTLS Reset or create a LAS object depending on the input's type
stem.hough Stem denoising algorithm: Hough Transform
stemPoints Stem points classification Stem segmentation algorithm: RANSAC circle fit
tlsAlter Alter point cloud's coordinates
tlsSample Resample a point cloud
treeMap Map tree occurrences from TLS data
gpsTimeFilter Filter points based on gpstime
map.hough Tree mapping algorithm: Hough Transform
tlsCrop Point cloud cropping
tlsNormalize Normalize a TLS point cloud
readTLS Import a point cloud file into a LAS object
randomize Point sampling algorithm: random sample
voxelize Point sampling algorithm: systematic voxel grid
treePositions Get unique tree positions from a tree_map
tlsPlot Plot TLS outputs
No Results!

Last month downloads


Type Package
License GPL-3
Encoding UTF-8
LazyData true
LinkingTo Rcpp,BH,RcppEigen
RoxygenNote 6.1.0
NeedsCompilation yes
Packaged 2019-03-12 21:06:08 UTC; tiago
Repository CRAN
Date/Publication 2019-03-13 15:43:25 UTC

Include our badge in your README