glcmTextures: Create texture variables based on glcm

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Wrapper arround glcm in order to create a set of texture variables.

Usage

1
2
3
4
5
glcmTextures(x, n_rasters = 1:nlayers(x), kernel_size = 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 = 32, min_x = NULL,
  max_x = NULL)

Arguments

x

rasterLayer or a rasterStack containing different channels

n_rasters

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

kernel_size

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

stats

string vector of parameters to be calculated. See glcm

parallel

logical value indicating whether parameters are calculated parallel or not

n_grey

number of grey values. see glcm

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.

Details

This functions calls the glcm function from glcm with standard settings

Value

list of RasterStacks containing the texture parameters for each combination of channel and kernel_size

Note

for the use glcmTextures a glcm wrapper function a raster* object is required

More information at the texture tutorial site of http://www.fp.ucalgary.ca/mhallbey/more_informaton.htm(Mryka Hall-Beyer) Keep in mind that:
Homogeneity is correlated with Contrast, r = -0.80 Homogeneity is correlated with Dissimilarity, r = -0.95 GLCM Variance is correlated with Contrast, r= 0.89 GLCM Variance is correlated with Dissimilarity, r= 0.91 GLCM Variance is correlated with Homogeneity, r= -0.83 Entropy is correlated with ASM, r= -0.87 GLCM Mean and Correlation are more independent. For the same image, GLCM Mean shows r< 0.1 with any of the other texture measures demonstrated in this tutorial. GLCM Correlation shows r<0.5 with any other measure.

Author(s)

Hanna Meyer

See Also

glcm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
## example on how to calculate texture from a list of channels

url<-"http://www.ldbv.bayern.de/file/zip/5619/DOP%2040_CIR.zip"
res <- curl::curl_download(url, "testdata.zip")
unzip(res,junkpaths = TRUE,overwrite = TRUE)
r<- raster::stack(paste0(getwd(),"4490600_5321400.tif"))

# call glcm wrapper
result <- glcmTextures(r,n_rasters=1:3,
stats=c("mean", "variance", "homogeneity"))

#plot the results from VIS0.6 channel:
raster::plot(unlist(unlist(glcm$size_3$X4490600_5321400.1)))

## End(Not run)

environmentalinformatics-marburg/satelliteTools documentation built on May 16, 2019, 8:16 a.m.