ccLabel: ccLabel

Description Usage Arguments Details Value See Also Examples

View source: R/ccLabel.R

Description

Labels groups of pixels in a raster object that share similar attributes.

Usage

1
ccLabel(x, method = "simple", change.threshold = NULL)

Arguments

x

Object of class RasterLayer, RasterStack or RasterBrick.

method

Labeling method. Choose between 'simple' and 'change'. Default is 'simple'.

change.threshold

Numeric element.

Details

Uses a 8-neighbor connected component labeling algorithm (determined by method) to identify groups of pixels of the same value. Each group receives a distinct numeric label. The function provides two connected component labeling algorithms:

When using the spatial and temporal methods, the value of change.threshold will influence the output. If the value is negative, the function will return the pixels that are below the threshold and vice versa when positive. Let's assume we are dealing with crop fields. When, using a negative threshold and the spatial method, the function will return homogeneous groups of pixels. This happens because the borders of between fields offer a contract and thus receive higher MAPE values. However, if we apply the same threshold when using the temporal method, the borders will be highlighted. This happens because the crop fields are more variant over time due to their fast growth while the borders remain virtually unchanged. The final output of the function is a list consisting of:

Value

A list.

See Also

classModel rankPlots

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{

require(raster)

# read raster data
r <- brick(system.file("extdata", "ndvi.tif", package="fieldRS"))

# spatial change labeling
or <- ccLabel(r[[1]], method="spatial", change.threshold=10)
plot(or$regions)

# temporal change labeling
or <- ccLabel(r, method="temporal", change.threshold=80)
plot(or$regions)

}

fieldRS documentation built on July 8, 2020, 5:37 p.m.