rPatches: Determine foreground patches in a raster

Description Usage Arguments Value See Also Examples

Description

(Foreground) Patches are sets of cells which are connected either directly or via other cells in a binarised raster and which should hence be treated as distinct objects.

Usage

1
rPatches(obj, kernel = NULL, background = NULL)

Arguments

obj

[RasterLayer(1)]
The object to modify.

kernel

[matrix(1)]
scan the raster with this kernel (default is a 3 by 3 cells diamond kernel).

background

[integerish(1)]
the value any cell with value NA should have.

Value

A RasterLayer of the same dimension as obj, in which neighbouring cells of the foreground have been assigned the same value, forming patches.

See Also

Other operators to determine objects: rCentroid, rSkeletonise

Examples

1
2
3
input <- rtRasters$continuous
binarised <- rBinarise(input, thresh = 30)
visualise(rPatches(binarised))

EhrmannS/rasterTools documentation built on May 28, 2019, 8:24 a.m.