uavRst (version 0.5-2)

glcm_texture: Calls the glcm package with useful settings

Description

Calls the glcm package with useful settings

Usage

glcm_texture(x, nrasters = 1:raster::nlayers(x), kernelSize = c(3),
  stats = c("mean", "variance", "homogeneity", "contrast",
  "dissimilarity", "entropy", "second_moment", "correlation"),
  shift = list(c(0, 1), c(1, 1), c(1, 0), c(1, -1)), parallel = TRUE,
  n_grey = 8, min_x = NULL, max_x = NULL)

Arguments

x

rasterLayer or a rasterStack containing different channels

nrasters

vector of channels to use from x. Default =nlayers(x)

kernelSize

vector of numbers indicating the environment sizes for which the textures are calculated

stats

string vector of parameters to be calculated.

shift

=list(c(0,1), c(1,1), c(1,0),c(1,-1))

parallel

logical value indicating whether parameters are calculated parallel or not

n_grey

number of grey values.

min_x

for each channel the minimum value which can occur. If NULL then the minimum value from the rasterLayer is used.

max_x

for each channel the maximum value which can occur. If NULL then the maximum value from the rasterLayer is used. This functions calls the glcm function from with standard settings and returns list of RasterStacks containing the texture parameters for each combination of channel and kernelSize

See Also

glcm package

Examples

Run this code
# NOT RUN {
require(glcm)
## example on how to calculate texture with glcm
owd <- getwd()
setwd(tempdir())
data("pacman")
# call glcm wrapper
result <- glcm_texture(pacman,
                       nrasters=1:3,
                       stats=c("mean", "variance", "homogeneity"),
                       parallel = FALSE)

#plot the result:
raster::plot(result[[1]])
setwd(owd)
# }

Run the code above in your browser using DataLab