FocalStatistics: moving-window mean, sum, min, max, range, median,
sample variance or standard deviation, or Shannon entropy, as
terra::focal (cells outside the grid are NA).
FilterKernel: mean, binomial, Gaussian, Laplacian, sharpen,
Prewitt, Sobel and Gabor kernels. FocalFilter: weighted window sum
(correlation) as terra::focal(x, w, fun = "sum"). CannyEdges:
Canny (1986) detector. GreyMorphology: erosion, dilation, opening
and closing with a flat square element. Identical to the Python arm
morie.fn.rastops.
Usage
FocalStatistics(grid, size = 3, fun = "mean", na_rm = FALSE)
FilterKernel(
name,
size = 3,
sigma = 1,
theta = 0,
wavelength = 4,
gamma = 0.5,
psi = 0
)
FocalFilter(grid, kernel, na_rm = FALSE)
CannyEdges(grid, sigma = 1, low = 0.1, high = 0.2, size = 5)
GreyMorphology(grid, operation, size = 3)Arguments
- grid
Numeric matrix (row 1 = north).
- size
Window or kernel size (odd).
- fun
Statistic.
- na_rm
Drop
NAvalues.- name
Kernel name.
- sigma, theta, wavelength, gamma, psi
Gaussian and Gabor parameters.
- kernel
Weight matrix.
- low, high
Hysteresis thresholds (fractions of the maximum gradient).
- operation
"erosion","dilation","opening"or"closing".
