Calculates texture index -- an average (over an array) of a product of the values of neighboring cells. The value of texture index is between 0 (fine texture), and 1 (coarse texture).
texture_index(x, ...)
SpatRaster or matrix containing two values: -1 and 1
Arguments for comat::get_coma()
A numeric vector
data(r_start, package = "spatialising")
texture_index(r_start)
#> [1] 0.9481633
ts1 = kinetic_ising(r_start, B = -0.3, J = 0.7)
texture_index(ts1)
#> [1] 0.9342857
ts2 = kinetic_ising(r_start, B = -0.3, J = 0.7, updates = 2)
texture_index(ts2)
#> [1] 0.9387755 0.9244898
# \donttest{
library(terra)
r1 = rast(system.file("raster/r_start.tif", package = "spatialising"))
texture_index(r1)
#> [1] 0.9481633
r2 = kinetic_ising(r1, B = -0.3, J = 0.7)
texture_index(r2)
#> [1] 0.9342857
# }