Get statistics for every point in a LAS
object. Neighborhood search methods are prefixed by ptm
.
fastPointMetrics(
las,
method = ptm.voxel(),
which_metrics = ENABLED_POINT_METRICS$names
)
LAS
object.
optional character
vector - list of metrics (by name) to be calculated. Check out fastPointMetrics.available
for a list of all metrics.
LAS
object.
* EVi = i-th 3D eigen value
* EV2Di = i-th 2D eigen value
N
: number of nearest neighbors
MinDist
: minimum distance among neighbors
MaxDist
: maximum distance among neighbors
MeanDist
: mean distance
SdDist
: standard deviation of within neighborhood distances
Linearity
: linear saliency, (EV_1 + EV_2) / EV_1(EV1 + EV2) / EV1
Planarity
: planar saliency, (EV_2 + EV_3) / EV_1(EV2 + EV3) / EV1
Scattering
: EV_3 / EV_1EV3 / EV1
Omnivariance
: (EV_2 + EV_3) / EV_1(EV2 + EV3) / EV1
Anisotropy
: (EV_1 - EV_3) / EV_1(EV1 - EV3) / EV1
Eigentropy
: - _i=1^n=3 EV_i * ln(EV_i)-sum(EV * ln(EV))
EigenSum
: sum of eigenvalues, _i=1^n=3 EV_isum(EV)
Curvature
: surface variation, EV_3 / EigenSumEV3 / EigenSum
KnnRadius
: 3D neighborhood radius
KnnDensity
: 3D point density (N / sphere volume)
Verticality
: absolute vertical deviation, in degrees
ZRange
: point neighborhood height difference
ZSd
: standard deviation of point neighborhood heights
KnnRadius2d
: 2D neighborhood radius
KnnDensity2d
: 2D point density (N / circle area)
EigenSum2d
: sum of 2D eigenvalues, _i=1^n=2 EV2D_isum(EV2D)
EigenRatio2d
: EV2D_2 / EV2D_1EV2D2 / EV2D1
EigenValuei
: 3D eigenvalues
EigenVectorij
: 3D eigenvector coefficients, i-th load of j-th eigenvector
Individual or voxel-wise point metrics build up the basis for many studies involving TLS in forestry. This function is used internally in other TreeLS methods for tree mapping and stem denoising, but also may be useful to users interested in developing their own custom methods for point cloud classification/filtering of vegetation features or build up input datasets for machine learning classifiers.
fastPointMetrics
provides a way to calculate several geometry related metrics (listed below) in an optimized way.
All metrics are calculated internally by C++ functions in a single pass (O(n) time), hence fast.
This function is provided for convenience, as it allows very fast calculations of several complex variables
on a single line of code, speeding up heavy work loads. For a more flexible approach that allows user defined
metrics check out point_metrics
from the lidR package.
In order to avoid excessive memory use, not all available metrics are calculated by default.
The calculated metrics can be specified every time fastPointMetrics
is run by naming the desired metrics
into the which_metrics
argument, or changed globally for the active R session by setting new default
metrics using fastPointMetrics.available
.
Wang, D.; Hollaus, M.; Pfeifer, N., 2017. Feasibility of machine learning methods for separating wood and leaf points from terrestrial laser scanning data. ISPRS Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume IV-2/W4.
Zhou, J. et. al., 2019. Separating leaf and wood points in terrestrial scanning data using multiple optimal scales. Sensors, 19(8):1852.
# NOT RUN {
file = system.file("extdata", "pine.laz", package="TreeLS")
tls = readTLS(file, select='xyz')
all_metrics = fastPointMetrics.available()
my_metrics = all_metrics[c(1,4,6)]
tls = fastPointMetrics(tls, ptm.knn(10), my_metrics)
head(tls@data)
plot(tls, color='Linearity')
# }
Run the code above in your browser using DataLab