21 #ifndef otbISRAUnmixingImageFilter_hxx
22 #define otbISRAUnmixingImageFilter_hxx
33 template <
class TInput,
class TOutput,
class TPrecision>
38 template <
class TInput,
class TOutput,
class TPrecision>
44 template <
class TInput,
class TOutput,
class TPrecision>
48 m_OutputSize = m_U.cols();
53 template <
class TInput,
class TOutput,
class TPrecision>
59 template <
class TInput,
class TOutput,
class TPrecision>
64 for (
unsigned int i = 0; i < in.GetSize(); ++i)
72 unsigned int nbEndmembers = m_OutputSize;
73 unsigned int nbBands = in.Size();
76 for (
unsigned int i = 0; i < m_MaxIteration; ++i)
82 for (
unsigned int e = 0; e < nbEndmembers; ++e)
87 for (
unsigned int b = 0; b < nbBands; ++b)
89 numerator += in[b] * m_U(b, e);
92 for (
unsigned int s = 0; s < nbEndmembers; ++s)
95 dot += m_U(b, s) * outVector[s];
97 denominator += dot * m_U(b, e);
100 outVectorNew[e] *= (numerator / denominator);
104 outVector = outVectorNew;
108 for (
unsigned int i = 0; i < out.GetSize(); ++i)
110 out[i] = outVector[i];
vnl_matrix< PrecisionType > MatrixType
vcl_size_t OutputSize(const std::array< vcl_size_t, 1 > &nbBands) const
void SetEndmembersMatrix(const MatrixType &U)
vnl_vector< PrecisionType > VectorType
const MatrixType & GetEndmembersMatrix(void) const
OutputType operator()(const InputType &in) const
vnl_svd< PrecisionType > SVDType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.