{
this->m_Histogram[ v ] = 0;
- typedef
- fpa::Image::Functors::RegionGrowThresholdFunction< I >
- TFunction;
- TFunction* function =
- dynamic_cast< TFunction* >( this->GetMembershipFunction( ) );
- if( function != NULL )
- {
- function->SetLowerThreshold( this->m_Histogram.begin( )->first );
- function->SetUpperThreshold( this->m_Histogram.rbegin( )->first );
-
- } // fi
+ /* TODO
+ typedef
+ fpa::Image::Functors::RegionGrowThresholdFunction< I >
+ TFunction;
+ TFunction* function =
+ dynamic_cast< TFunction* >( this->GetMembershipFunction( ) );
+ if( function != NULL )
+ {
+ function->SetLowerThreshold( this->m_Histogram.begin( )->first );
+ function->SetUpperThreshold( this->m_Histogram.rbegin( )->first );
+
+ } // fi
+ */
this->Modified( );
}
// -------------------------------------------------------------------------
template< class I >
void fpa::Image::RegionGrowWithMultipleThresholds< I >::
-AddThresholds(
- const TPixel& t0,
- const TPixel& t1,
- const unsigned int& samples
- )
+AddThresholds( const TPixel& t0, const TPixel& t1, const unsigned int& s )
{
- double off =
- ( double( t1 ) - double( t0 ) ) / ( double( samples ) - double( 1 ) );
- for( unsigned int s = 0; s < samples; s++ )
- this->AddThreshold( TPixel( ( double( s ) * off ) + double( t0 ) ) );
+ double o = ( double( t1 ) - double( t0 ) ) / ( double( s ) - double( 1 ) );
+ for( unsigned int i = 0; i < s; i++ )
+ this->AddThreshold( TPixel( ( double( i ) * o ) + double( t0 ) ) );
}
// -------------------------------------------------------------------------
void fpa::Image::RegionGrowWithMultipleThresholds< I >::
_AfterLoop( )
{
- typename THistogram::iterator prevIt = this->m_Histogram.begin( );
- typename THistogram::iterator currIt = prevIt; currIt++;
- typename THistogram::iterator nextIt = currIt; nextIt++;
- double prev_d1 = double( 0 );
- for( ; nextIt != this->m_Histogram.end( ); ++prevIt, ++currIt, ++nextIt )
- {
+ /*
+ typename THistogram::iterator prevIt = this->m_Histogram.begin( );
+ typename THistogram::iterator currIt = prevIt; currIt++;
+ typename THistogram::iterator nextIt = currIt; nextIt++;
+ double prev_d1 = double( 0 );
+ for( ; nextIt != this->m_Histogram.end( ); ++prevIt, ++currIt, ++nextIt )
+ {
double d1 = double( nextIt->second ) - double( prevIt->second );
d1 /= double( nextIt->first ) - double( prevIt->first );
std::cout
- << currIt->first << " "
- << currIt->second << " "
- << d1 << " "
- << ( d1 - prev_d1 ) << std::endl;
+ << currIt->first << " "
+ << currIt->second << " "
+ << d1 << " "
+ << ( d1 - prev_d1 ) << std::endl;
prev_d1 = d1;
- } // rof
-
+ } // rof
+ */
/*
double prev = double( 0 );