View source: R/LW_segmentation_graph.R
LW_segmentation_graph | R Documentation |
This algorithm uses the graph clustering framework presented in Wang et al. 2019 to compute the geometric features of clusters from which the p_wood and SoD indices are computed. However, unlike the Wang et al. 2019 method, this algorithm does not use post-clustering partitioning, which is a long process, and replace it by the inclusion of two additional geometric features to remove inconstant edges from the graph. However, the three geometric features are all controlled by one parameter so it does not add any additional parameter to the original method. The class regularization step was also removed and replaced by the reclassification of points in small clusters.
LW_segmentation_graph(
las,
k = 10L,
search_radius = 0.05,
features_similarity = 0.15,
min_cluster_size = 10L,
reclass_trunk_th = 0.5
)
las |
a LAS file. |
k |
integer. The number of nearest neighbors to build the knn graph. |
search_radius |
numeric. The searching distance to compute geometric features.
Note that |
features_similarity |
numeric. Sets the thresholds in geometric features used to trim the knn graph. It sets how similar the points in a cluster must be. Typically between 0.1 and 0.2. |
min_cluster_size |
integer. The minimal size of a cluster required to compute the indices. Points located in small clusters receive 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_graph(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.