mesma | R Documentation |
mesma
performs a multiple endmember spectral mixture analysis on a multiband raster image.
For unmixing, a non-negative least squares (NNLS) regression which is using a sequential coordinate-wise algorithm (SCA) based on Franc et al. (2005).
## S4 method for signature 'SpatRaster'
mesma(x, em, iterate=400, tolerance=0.00000001, ...)
x |
SpatRaster. Usually representing a hyperspectral remotely sensed image |
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 |
iterate |
integer. Set maximum iteration per pixel. Processing time could increase the more iterations are made possible |
tolerance |
numeric. Tolerance limit representing a nearly zero minimal number |
... |
further arguments passed to writeRaster |
SpatRaster with one layer per end-member, with each value representing the estimated presence probability of the end-member per pixel (0 to 1), and an RMSE layer.
Depending on iterate
and tolerance
settings, the sum of estimated presence probabilities per pixel varies around 1.
Jakob Schwalb-Willmann
Franc, V., Hlaváč, 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.
lsat <- rast(system.file("ex/lsat.tif", package="luna"))
# 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)
# take a look
hist(probs$water)
plot(probs$water, col = c("white","blue"))
hist(probs$land)
plot(probs$land, col = c("white","brown"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.