OTB
6.7.0
Orfeo Toolbox

#include <otbNCLSUnmixingImageFilter.h>
Performs fully constrained least squares on each pixel of a VectorImage.
This filter takes as input a multiband image and a matrix. If the matrix is called , it solves, for each pixel , the system in the least square sense, with additional constraints on the solution ensuring positivity (each component is positive) and additivity (the sum of all components is 1).
The main use of this filter is to unmix an hyperspectral dataset, where is the mixing matrix, in which each row corresponds to an endmember signature.
The number of rows in must match the input image number of bands. The number of bands in the output image will be the number of columns of $A$
References "Fully Constrained LeastSquares Based Linear Unmixing." Daniel Heinz, CheinI Chang, and Mark L.G. Althouse. IEEE. 1999.