View source: R/LW_segmentation_dbscan.R
LW_segmentation_dbscan | R Documentation |
This function implements the method presented in Wan et al. 2020 but replace the connected component algorithm by a dbscan clustering.
LW_segmentation_dbscan(
las,
k = 10L,
search_radius = 0.05,
dbscan_eps = 0.03,
min_cluster_size = 10L,
reclass_trunk_th = 0.5
)
las |
a LAS file. |
k |
integer. The number of nearest neighbors to use in the geometric features computation |
search_radius |
numeric. The searching distance to compute geometric features.
Note that |
dbscan_eps |
numeric. Sets the esp parameter to pass to the
|
min_cluster_size |
integer. The minimal size of a cluster required to compute the indices. Points located in small clusters recieve a p_wood and SoD of their nearest well classified point. |
reclass_trunk_th |
numeric. The minimal Threshold to reclass the lower clusters (i.e. the clusters with at least
one point with |
a LAS with two additionnal fields, p_wood
and SoD
, corresponding to a wood classification index. p_wood
was introduced in Wang et al. 2019 and range from 0 to 1 with 1 being very high probability of wood. SoD
was introduced
in Wan et al. 2020 and range between -1 and 1, higher probability of wood class close to 1.
Wang, D., Momo Takoudjou, S., & Casella, E. (2020). LeWoS: A universal leaf‐wood classification method to facilitate the 3D modelling of large tropical trees using terrestrial LiDAR. Methods in Ecology and Evolution, 11(3), 376-389.
Wan, P., Zhang, W., Jin, S., Wang, T., Yang, S., & Yan, G. (2020). Plot-level wood-leaf separation of trees using terrestrial LiDAR data based on a segmentwise geometric feature classification method. Methods in Ecology and Evolution, 12, 2473–2486.
# import the data
file = system.file("extdata", "tree_leaves.las", package="lidUrb")
las = lidR::readLAS(file)
# clean and reduce point density
las = lidUrb::filter_noise(las,k = 6L, sigma = 0.8)
las = lidUrb::reduce_point_density(las,0.02)
# compute two criterias for wood and leaves classification
las = LW_segmentation_dbscan(las)
# plot the two wood indexes criterias
lidR::plot(las,color = "p_wood",legend = TRUE)
lidR::plot(las,color = "SoD",legend = TRUE)
# assign a class base on p_wood
las@data[,wood := as.numeric(p_wood >= 0.9)]
# plot the hard classification
lidR::plot(las,color="wood",size=2,colorPalette = c("chartreuse4","cornsilk2"))
# assign a class base on p_wood
las@data[,wood := as.numeric(SoD >= 0.99)]
# plot the hard classification
lidR::plot(las,color="wood",size=2,colorPalette = c("chartreuse4","cornsilk2"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.