# read example data
# \donttest{
file = system.file("extdata", "beech.las", package="CspStandSegmentation")
las = lidR::readTLSLAS(file)
# Find tree positions as starting points for segmentation
map <- CspStandSegmentation::find_base_coordinates_raster(las)
# segment trees
segmented <- las |>
CspStandSegmentation::add_geometry() |>
CspStandSegmentation::csp_cost_segmentation(map, 1, S_w = 0.5)
# }
Run the code above in your browser using DataLab