Learn R Programming

RStoolbox (version 0.2.6)

mesma: Multiple Endmember Spectral Mixture Analysis (Spectral Unmixing)

Description

mesma performs a multiple endmember spectral mixture analysis on a multiband raster image.

Usage

mesma(img, em, method = "NNLS", iterate = 400, tolerance = 1e-08,
  ..., verbose)

Arguments

img

RasterBrick or RasterStack. Remote sensing imagery (usually hyperspectral).

em

Matrix or data.frame with spectral endmembers. Rows represent a single endmember of a class, columns represent the spectral bands (i.e. columns correspond to number of bands in img). Number of rows needs to be > 1.

method

Character. Select an unmixing method. Currently, only "NNLS" is implemented. Default is "NNLS".

  • NNLS: applies a non-negative least squares (NNLS) regression which is using a sequential coordinate-wise algorithm (SCA) based on Franc et al. (2005).

iterate

Integer. Set maximum iteration per pixel. Processing time could increase the more iterations are made possible. Default is 400.

tolerance

Numeric. Tolerance limit representing a nearly zero minimal number. Default is 1e-8.

...

further arguments passed to writeRaster.

verbose

Logical. Prints progress messages during execution.

Value

RasterBrick. The object will contain one band per endmember, with each value representing the estimated presence probability of the endmember per pixel (0 to 1), and an RMSE band.

References

Franc, V., Hlav<U+00E1><U+010D>, V., & Navara, M. (2005). Sequential coordinate-wise algorithm for the non-negative least squares problem. In: International Conference on Computer Analysis of Images and Patterns (pp. 407-414). Berlin, Heidelberg.

Examples

Run this code
# NOT RUN {
#load packages
library(raster)
library(RStoolbox)

#load an example dataset
data(lsat)

#make up some endmember spectra: water and land
em_names <- c("water", "land")
pts <- data.frame(class=em_names, cell = c(47916,5294))
em <- lsat[pts$cell]
rownames(em) <- em_names

#unmix the image for water and land
probs <- mesma(lsat, em, method = "NNLS")

#take a look
raster::hist(probs$water)
raster::plot(probs$water, col = c("white","blue"))
raster::hist(probs$land)
raster::plot(probs$land, col = c("white","brown"))

# }

Run the code above in your browser using DataLab