I'm trying to identify snags using LiDAR stored in las format. The Wing 2015 algorithm used in segment_snags requires the values be in the range from 0 to 255. Is it possible to edit and scale intensity values (not by adding a new attribute)? Alternatively, is it possible to edit the segment_snags tool in lidR?
If your intensities are recorded on 16 bits you can use the
las@data[, Intensity := as.integer(Intensity/(2^16-1)*255L)]
If your intensities are somehow arbitrary recorded
las@data[, Intensity := as.integer(Intensity/max(Intensity)*255L)]
With a more regular R syntax
las$Intensity = as.integer(las$Intensity/max(las$Intensity)*255L)
I don't remember how Wing's algo work but first read the original paper to ensure that rescaling like that has a meaning for the method.
Alternatively, is it possible to edit the
segment_snagstool in lidR?
This might be the object of a feature request.