Learn R Programming

lidR (version 2.1.4)

lastrees: Individual tree segmentation

Description

Individual tree segmentation with several possible algorithms. The returned point cloud has a new extra byte attribute named after the parameter attribute independently of the algorithm used.

Usage

lastrees(las, algorithm, attribute = "treeID")

Arguments

las

An object of class LAS.

algorithm

function. An algorithm of individual tree segmentation. lidR has: dalponte2016, watershed, mcwatershed, li2012 and silva2016. More experimental algorithms may be found in the package lidRplugins

attribute

character. The returned LAS object as a new extra byte attribute (in a new column). This parameter controls the name of the new attribute. Default is "treeID".

Value

An object of the class LAS

Examples

Run this code
# NOT RUN {
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyz", filter = "-drop_z_below 0")
col <- pastel.colors(200)

# Using Li et al. (2012)
las <- lastrees(las, li2012(R = 3, speed_up = 5))
plot(las, color = "treeID", colorPalette = col)
# }

Run the code above in your browser using DataLab