std: Texture Direction Metrics

Description Usage Arguments Value Examples

View source: R/fourier.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(raster)

# import raster image
data(normforest)

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

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

geodiv documentation built on Sept. 5, 2021, 5:26 p.m.