d -= TValue( image->GetPixel( p ) );
d /= this->m_Beta;
d *= d;
- if( this->m_TreatAsWeight ) d = std::exp( d );
+ if( this->m_TreatAsWeight ) d = std::exp( d ) - TValue( 1 );
else d = std::exp( -d );
if( d < this->m_Epsilon ) return( this->m_Epsilon );