Jean-Romain / lidRplugins

Extra functions and algorithms for lidR package
42 stars 15 forks source link

Possible pathological case for lmfauto() #20

Open max-mapper opened 9 months ago

max-mapper commented 9 months ago

I was playing with lmfauto() and have a file where it takes about 45 minutes to complete find_trees on a 32 core machine, sharing in case it's useful, if not feel free to ignore.

library(lidR)
library(lidRplugins)
las = readLAS("L4_6624_1947.las")
ttops <- find_trees(las, lmfauto(hmin = 100))

https://drive.google.com/file/d/1ZgZHoOZ49uBkREvzDjruj3uWQagFsyLM/view?usp=sharing

Jean-Romain commented 9 months ago

Does regular lmf works as usual ?

max-mapper commented 9 months ago

Yes

# finished in about 5 minutes
ttops <- find_trees(las, lmf(ws = 2))
Local maximum filter: [==================================================] 100% (4 threads)

# after 10 minutes...
> ttops <- find_trees(las, lmfauto())
Local maximum filter: [--------------------------------------------------] 1% (4 threads)s)

Maybe what is happening is a large ws is being selected?

Jean-Romain commented 9 months ago

I have a lot of stuff to deal with these days. I'll try to investigate within a week.