#ifndef __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__HXX__ #define __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__HXX__ // ------------------------------------------------------------------------- template< class I, class S > bool fpa::Image::Functors::GaussianModelEstimatorFunction< I, S >:: Evaluate( const typename I::PixelType& rgb ) const { if( !this->m_Estimating ) { this->m_Estimator->AddSample( this->m_YPbPrFunction( rgb ) ); if( this->m_Estimator->GetNumberOfSamples( ) == this->m_ModelSupport ) { this->m_Estimating = true; this->m_Estimator->UpdateModel( ); } // fi return( true ); } else { S p = this->m_Estimator->Probability( this->m_YPbPrFunction( rgb ) ); return( p >= this->m_Estimator->GetMinimumProbability( ) ); } // fi } // ------------------------------------------------------------------------- template< class I, class S > fpa::Image::Functors::GaussianModelEstimatorFunction< I, S >:: GaussianModelEstimatorFunction( ) : Superclass( ), m_ModelSupport( 10 ) { this->m_Estimator = TEstimator::New( ); this->m_Estimator->Clear( ); this->m_Estimating = false; } // ------------------------------------------------------------------------- template< class I, class S > fpa::Image::Functors::GaussianModelEstimatorFunction< I, S >:: ~GaussianModelEstimatorFunction( ) { } #endif // __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__HXX__ // eof - $RCSfile$