tiagodc / TreeLS

R functions for processing individual tree TLS point clouds
GNU General Public License v3.0
82 stars 27 forks source link

tlsNormalize returns negative values, what does it really normalize? #41

Open mavavilj opened 3 years ago

mavavilj commented 3 years ago

tlsNormalize returns negative values, what does it really normalize?

My 3D point clouds are such that the z varies from about z=70 to z=90 where the data lies.

Should I perhaps translate my data to origin first?

bi0m3trics commented 3 years ago

tlsNormalize is just a wrapper function that calls lidR::grid_terrain(algorithm = knnidw()) and then lidR::normalize_height with the resulting dtm [and of course lidR::classify_ground(algo=csf()) if you don't have Classification == 2] so my guess would be that it has to do with your point density (i.e., lack of sufficient points to build the dtm and thus it normalizes with "high" points resulting in negative values) or the defaults passed in TreeLS, but these are just guesses. I suggest reading lines 530-553 (linked above) and just write your own own function that suits your specific needs.

mavavilj commented 3 years ago

I inputted it already extracted trees. Does it require the ground points as well?

I also didn't understand from the code, how does it check whether normalization is in place? I checked some of the code:

https://github.com/tiagodc/TreeLS/blob/9033693503ee71ace2335a6b8fa2dce864df37cd/R/methods.R#L114-L115

So is it enough that the lowest Z of the cloud is in [0,1]?