Molina-Valero / FORTLS

Automatic Processing of Terrestrial-Based Technologies Point Cloud Data for Forestry Purposes
https://CRAN.R-project.org/package=FORTLS
21 stars 7 forks source link

Tree detection #6

Closed ekholoud closed 2 years ago

ekholoud commented 2 years ago

I installed your library "FORTLS" and I would like to use it for tree detection on my TLS point cloud but I didnt find any example of code in your repository that I can use . Could you please give me a an example of code that I can apply on my case to detect trees. Thank you for your help.

Molina-Valero commented 2 years ago

Please, install the last version of CRAN (https://cran.r-project.org/package=FORTLS) or the devel branch of GitHub (remotes::install_github("Molina-Valero/FORTLS", ref = "devel", dependencies = TRUE)).

Define working directory where yo have the las or laz files:

setwd("...")

For single scan:

pcd_single <- normalize(las = "your_file.las")

tls.resolution = list(point.dist = 6.34, tls.dist = 10) tree.tls <- tree.detection.single.scan(data = pcd_single, tls.resolution = tls.resolution, breaks = c(1, 1.3, 1.6))

For multi scan:

pcd_multi <- normalize(las = "Galicia_multi_scan.laz", max.dist = 15, scan.approach = "multi")

tree.tls <- tree.detection.multi.scan(data = pcd_multi[pcd_multi$prob.selec == 1, ], stem.section = c(1, 6), # Here define a stem setion without branches or noisy points breaks = c(1, 1.3, 1.6))

If you have troubles detecting trees, maybe you could pass me your las files to try it.

Best regards, Juan Alberto

ekholoud commented 2 years ago

I got these errors after running the code that you sent : In tree.detection.single.scan(data = pcd_single, tls.resolution = tls.resolution, : No tree was detected for plot 1 Here is my point cloud https://drive.google.com/file/d/1FSxQwuP_GDtvi9k7tQbBG_h5AxxqV1Zl/view?usp=sharing Thanks for your help Best regards, Kholoud

Molina-Valero commented 2 years ago

I have detected arround 14 trees with the next code, but you will need to install the last version of the devel branch:

setwd("...")

pcd_multi <- normalize(las = "vegetation.las", scan.approach = "multi")

tree.tls <- tree.detection.multi.scan(data = pcd_multi, tls.precision = 0.05, slice = 0.2, # I have included this parameter to get wider slices in tree detection because your point cloud is not very dense stem.section = c(1, 6))

If I get better results I will let you know. You can also give me feedback if you try with more point clouds.

Best, Juan Alberto

Molina-Valero commented 2 years ago

I attach you the script file: issues.txt

Molina-Valero commented 2 years ago

I have detected more trees, but your point coud it is being challenging for me because of the low density. ¿Which device did you use? and ¿which precision? issues.txt Best, Juan Alberto