r-lidar / lidR

Airborne LiDAR data manipulation and visualisation for forestry application
https://CRAN.R-project.org/package=lidR
GNU General Public License v3.0
587 stars 132 forks source link

individual tree segmentation #656

Closed fvcamargo closed 1 year ago

fvcamargo commented 1 year ago

Hello, I am working with UAV based LIDAR DJI L1 point cloud over cherry orchard.

It does not segment the trees individually, may you check the script, please? Also give me insights about? Thanks

las <- readLAS("Malaucene_6oct_lidar.las")

chm1 <- rasterize_canopy(las, res = 0.5, p2r(0.3), pkg = "raster")
ker <- matrix(1,3,3)
chm1 <- raster::focal(chm1, w = ker, fun = mean, na.rm = TRUE)
ttops3 <- find_trees(chm1, lmf(4, 2))
las4 = segment_trees(las, silva2016(chm1, ttops3))

writeLAS(las4, "Oct6Lidar-.las")
Jean-Romain commented 1 year ago

I does not work is not a question. Please elaborate. The code looks good