diff --git a/Code/Learning/otbGaussianAdditiveNoiseSampleListFilter.txx b/Code/Learning/otbGaussianAdditiveNoiseSampleListFilter.txx index 4c6789f85bf36b0200848e0b852dfd93a20983e4..cd1130a11f9db8fefc797c0d06bd890c47f0616f 100644 --- a/Code/Learning/otbGaussianAdditiveNoiseSampleListFilter.txx +++ b/Code/Learning/otbGaussianAdditiveNoiseSampleListFilter.txx @@ -41,6 +41,10 @@ GaussianAdditiveNoiseSampleListFilter<TInputSampleList,TOutputSampleList> typedef itk::Statistics::MersenneTwisterRandomVariateGenerator GeneratorType; GeneratorType::Pointer generator = GeneratorType::New(); + // Clear the coefficients vector first + m_WhiteGaussianNoiseCoefficients.clear(); + + // Get the size of the measurement vectors unsigned int size = this->GetInput()->Get()->GetMeasurementVectorSize(); if(size == 0) {