18 #ifndef __otbISRAUnmixingImageFilter_txx
19 #define __otbISRAUnmixingImageFilter_txx
30 template <
class TInput,
class TOutput,
class TPrecision>
38 template <
class TInput,
class TOutput,
class TPrecision>
44 template <
class TInput,
class TOutput,
class TPrecision>
52 template <
class TInput,
class TOutput,
class TPrecision>
60 template <
class TInput,
class TOutput,
class TPrecision>
68 template <
class TInput,
class TOutput,
class TPrecision>
74 m_OutputSize = m_U.cols();
75 m_Svd.reset(
new SVDType(m_U) );
79 template <
class TInput,
class TOutput,
class TPrecision>
87 template <
class TInput,
class TOutput,
class TPrecision>
94 for (
unsigned int i = 0; i < in.GetSize(); ++i )
100 VectorType outVector = m_Svd->solve(inVector);
102 unsigned int nbEndmembers = m_OutputSize;
103 unsigned int nbBands = in.Size();
106 for (
unsigned int i = 0; i < m_MaxIteration; ++i)
112 for (
unsigned int e = 0; e < nbEndmembers; ++e)
117 for (
unsigned int b = 0; b < nbBands; ++b)
119 numerator += in[b] * m_U(b, e);
122 for (
unsigned int s = 0; s < nbEndmembers; ++s)
125 dot += m_U(b, s) * outVector[s];
127 denominator += dot * m_U(b, e);
130 outVectorNew[e] *= (numerator/denominator);
134 outVector = outVectorNew;
138 for (
unsigned int i = 0; i < out.GetSize(); ++i )
140 out[i] = outVector[i];
147 template <
class TInputImage,
class TOutputImage,
class TPrecision>
153 template <
class TInputImage,
class TOutputImage,
class TPrecision>
159 template <
class TInputImage,
class TOutputImage,
class TPrecision>
164 this->GetFunctor().SetEndmembersMatrix(m);
168 template <
class TInputImage,
class TOutputImage,
class TPrecision>
173 return this->GetFunctor().GetEndmembersMatrix();
176 template <
class TInputImage,
class TOutputImage,
class TPrecision>
181 Superclass::PrintSelf(os, indent);