
Last chance! 50% off unlimited learning
Sale ends in
This functions is made to be used in segment_trees. It implements an algorithm for tree
segmentation based on the Silva et al. (2016) article (see reference). This is a simple method
based on seed + voronoi tesselation (equivalent to nearest neighbour). This algorithm is implemented
in the package rLiDAR
. This version is not the version from rLiDAR
. It is
code written from the original article by the lidR authors and is considerably (between 250
and 1000 times) faster.
silva2016(chm, treetops, max_cr_factor = 0.6, exclusion = 0.3, ID = "treeID")
RasterLayer. Image of the canopy. Can be computed with grid_canopy or read from an external file.
SpatialPointsDataFrame
. Can be computed with
find_trees or read from an external shapefile.
numeric. Maximum value of a crown diameter given as a proportion of the tree height. Default is 0.6, meaning 60% of the tree height.
numeric. For each tree, pixels with an elevation lower than exclusion
multiplied by the tree height will be removed. Thus, this number belongs between 0 and 1.
character. If the SpatialPointsDataFrame
contains an attribute with the ID for
each tree, the name of this column. This way, original IDs will be preserved. If there is no such
data trees will be numbered sequentially.
Because this algorithm works on a CHM only there is no actual need for a point cloud. Sometimes the
user does not even have the point cloud that generated the CHM. lidR
is a point cloud-oriented
library, which is why this algorithm must be used in segment_trees to merge the result into the point
cloud. However, the user can use this as a stand-alone function like this:
chm = raster("file/to/a/chm/") ttops = find_trees(chm, lmf(3)) crowns = silva2016(chm, ttops)()
Silva, C. A., Hudak, A. T., Vierling, L. A., Loudermilk, E. L., O<U+2019>Brien, J. J., Hiers, J. K., Khosravipour, A. (2016). Imputation of Individual Longleaf Pine (Pinus palustris Mill.) Tree Attributes from Field and LiDAR Data. Canadian Journal of Remote Sensing, 42(5), 554<U+2013>573. https://doi.org/10.1080/07038992.2016.1196582.
Other individual tree segmentation algorithms:
dalponte2016()
,
li2012()
,
watershed()
Other raster based tree segmentation algorithms:
dalponte2016()
,
watershed()
# NOT RUN {
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
poi <- "-drop_z_below 0 -inside 481280 3812940 481320 3812980"
las <- readLAS(LASfile, select = "xyz", filter = poi)
col <- pastel.colors(200)
chm <- grid_canopy(las, res = 0.5, p2r(0.3))
ker <- matrix(1,3,3)
chm <- raster::focal(chm, w = ker, fun = mean, na.rm = TRUE)
ttops <- find_trees(chm, lmf(4, 2))
las <- segment_trees(las, silva2016(chm, ttops))
#plot(las, color = "treeID", colorPalette = col)
# }
Run the code above in your browser using DataLab