std: Texture Direction Metrics

View source: R/fourier.R

stdR Documentation

Texture Direction Metrics

Description

Calculates the angle of dominating texture and the texture direction index of the Fourier spectrum image calculated from a raster image (see Kedron et al. 2018).

Usage

std(x, create_plot = FALSE, option = c(1, 2))

Arguments

x

A raster or matrix.

create_plot

Logical. If TRUE, returns a plot of the amplitude spectrum with lines showing directions in which amplitude is summed for the Std and Stdi calculations. Plotting is not possible when input is a matrix.

option

Numeric. Code for which output metric(s) to return. 1 = Std, 2 = Stdi.

Value

A vector containing numeric values for the angle of dominating texture and the texture direction index.

Examples

# import raster image
data(normforest)
normforest <- terra::unwrap(normforest)

# calculate Std and Stdi
stdvals <- std(normforest)

# extract each value
Std <- stdvals[1]
Stdi <- stdvals[2]

geodiv documentation built on Oct. 6, 2023, 1:07 a.m.