extrap {nnDiag}R Documentation

Extrapolations Test

Description

Comparison of the range of observations in the feature space of both the reference set and target set. Any target set pixel whose value is beyond the range of the reference set's feature space requires an extrapolation during kNN classification. This function prepares an object to plot the comparison and find if and where an extrapolation is necessary.

Usage

extrap(image, refSet.spectral, mask = NULL, verbose = TRUE)

Arguments

image the target set image, either an object of class GDALReadOnlyDataset or an object of class "nnDaoi"
refSet.spectral matrix of the feature space values of the reference set
mask optional mask, as an object of class GDALReadOnlyDataset
verbose logical indicating whether to display a progress bar

Details

Both the image and mask have to be in the class "GDALReadOnlyDataset". This can be achieved by using the command GDAL.open from the package rgdal.

Value

Returns an object of class "nnDext", which is a list containing the following components:

image.range a matrix of the range of spectral values found on the image or in the AOIs for each spectral layer
refSet.range a matrix of the range of spectral values for the reference set of data elements

Author(s)

Brian Walters walte137@msu.edu

References

McRoberts, R.E. (2009) Diagnostic tools for nearest neighbors techniques when used with satellite imagery, Remote Sensing of Environment. 113, 489–499.

See Also

aoiMaker

Examples

data(LuceVolume_subset)
LuceTasscap <- GDAL.open(system.file("data/LuceSubset_Tcap.tif", package = "nnDiag"))
LuceMask <- GDAL.open(system.file("data/LuceSubset_Mask.tif", package = "nnDiag"))

spect <- as.matrix(LuceVolume_subset[12:14])
## Not run: 
x <- extrap(LuceTasscap, spect, LuceMask)
plot(x)

## Using an "nnDaoi" object
coords <- as.matrix(LuceVolume_subset[,10:11])
tcap.aoi <- aoiMaker(coords, 3, LuceTasscap, LuceMask, aoi.size = 20, min.points = 4)

x <- extrap(tcap.aoi, spect)
plot(x)## End(Not run)

[Package nnDiag version 0.0-5 Index]