View source: R/metrics_texture.R
metrics_texture | R Documentation |
Generates a suite of GLCM (Grey-Level Co-Occurence Matrix) metrics of a canopy height model (CHM). CHM is calculated on the fly
to allow easy integration with e.g. lidR::pixel_metrics
function.
metrics_texture(x, y, z, pixel_size, zmin = NA, chm_algorithm = NULL, ...)
.metrics_texture
x , y , z |
X, Y, Z coordinates of a point cloud |
pixel_size |
pixel size |
zmin |
numeric. Minimum |
chm_algorithm |
Function used to generate the CHM. By default |
... |
additional parameters passed to |
An object of class formula
of length 2.
Function first uses the lidR::rasterize_canopy()
algorithm to create a CHM.
ForestTools::glcm()
function is then used to calculate GLCM statistics (see package manual for details).
This implementation of GLCM does not allow for missing values - after CHM is created, any missing values are converted to 0.
A list. GLCM metrics.
library(lidR)
library(lidRmetrics)
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile, select = "*", filter = "-keep_random_fraction 0.5")
m1 <- cloud_metrics(las, ~metrics_texture(x = X, y = Y, z = Z, pixel_size = 1))
m2 <- pixel_metrics(las, ~metrics_texture(x = X, y = Y, z = Z, pixel_size = 1), res = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.