1 #ifndef __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__HXX__
2 #define __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__HXX__
4 // -------------------------------------------------------------------------
5 template< class I, class S >
6 bool fpa::Image::Functors::GaussianModelEstimatorFunction< I, S >::
7 Evaluate( const typename I::PixelType& rgb ) const
9 if( !this->m_Estimating )
11 this->m_Estimator->AddSample( this->m_YPbPrFunction( rgb ) );
12 if( this->m_Estimator->GetNumberOfSamples( ) == this->m_ModelSupport )
14 this->m_Estimating = true;
15 this->m_Estimator->UpdateModel( );
22 S p = this->m_Estimator->Probability( this->m_YPbPrFunction( rgb ) );
23 return( p > this->m_Estimator->GetMinimumProbability( ) );
28 // -------------------------------------------------------------------------
29 template< class I, class S >
30 fpa::Image::Functors::GaussianModelEstimatorFunction< I, S >::
31 GaussianModelEstimatorFunction( )
35 this->m_Estimator = TEstimator::New( );
36 this->m_Estimator->Clear( );
37 this->m_Estimating = false;
40 // -------------------------------------------------------------------------
41 template< class I, class S >
42 fpa::Image::Functors::GaussianModelEstimatorFunction< I, S >::
43 ~GaussianModelEstimatorFunction( )
47 #endif // __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__HXX__