te::rp::ClassifierKMeansStrategy Class Reference

KMeans strategy for image classification. Step-by-step: More...

#include <ClassifierKMeansStrategy.h>

Inheritance diagram for te::rp::ClassifierKMeansStrategy:
te::rp::ClassifierStrategy

Classes

class  Parameters
 Classifier Parameters. More...
 

Public Member Functions

 ClassifierKMeansStrategy ()
 
bool execute (const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, const std::vector< te::gm::Polygon * > &inputPolygons, te::rst::Raster &outputRaster, const unsigned int outputRasterBand, const bool enableProgressInterface) throw (te::rp::Exception)
 Executes the classification strategy. More...
 
bool initialize (StrategyParameters const *const strategyParams) throw (te::rp::Exception)
 Initialize the classification strategy. More...
 
 ~ClassifierKMeansStrategy ()
 

Protected Attributes

bool m_isInitialized
 True if this instance is initialized. More...
 
ClassifierKMeansStrategy::Parameters m_parameters
 Internal execution parameters. More...
 

Detailed Description

KMeans strategy for image classification. Step-by-step:

  1. Define a random solution, creating K values of mean.
  2. Classify each pixel according to the closest mean.
  3. Calculate new means using the classified pixels.
  4. Go back to step 2, or stop depending on the following checks:
  5. Check if the new means are different from the previous iteration, using the convergence threshold.
  6. Check if maximum number of iterations has achieved.

Definition at line 52 of file ClassifierKMeansStrategy.h.

Constructor & Destructor Documentation

te::rp::ClassifierKMeansStrategy::ClassifierKMeansStrategy ( )

Definition at line 81 of file ClassifierKMeansStrategy.cpp.

References m_isInitialized.

te::rp::ClassifierKMeansStrategy::~ClassifierKMeansStrategy ( )

Definition at line 86 of file ClassifierKMeansStrategy.cpp.

Member Function Documentation

bool te::rp::ClassifierKMeansStrategy::execute ( const te::rst::Raster inputRaster,
const std::vector< unsigned int > &  inputRasterBands,
const std::vector< te::gm::Polygon * > &  inputPolygons,
te::rst::Raster outputRaster,
const unsigned int  outputRasterBand,
const bool  enableProgressInterface 
)
throw (te::rp::Exception
)
virtual
bool te::rp::ClassifierKMeansStrategy::initialize ( StrategyParameters const *const  strategyParams)
throw (te::rp::Exception
)
virtual

Initialize the classification strategy.

Parameters
strategyParamsA pointer to the user given specific classification strategy parameters ou NULL if no parameters are present.
Returns
true if OK, false on errors.

Implements te::rp::ClassifierStrategy.

Definition at line 90 of file ClassifierKMeansStrategy.cpp.

References te::rp::ClassifierKMeansStrategy::Parameters::m_epsilon, m_isInitialized, te::rp::ClassifierKMeansStrategy::Parameters::m_K, te::rp::ClassifierKMeansStrategy::Parameters::m_maxInputPoints, te::rp::ClassifierKMeansStrategy::Parameters::m_maxIterations, m_parameters, TE_TR, and TERP_TRUE_OR_RETURN_FALSE.

Member Data Documentation

bool te::rp::ClassifierKMeansStrategy::m_isInitialized
protected

True if this instance is initialized.

Definition at line 100 of file ClassifierKMeansStrategy.h.

Referenced by ClassifierKMeansStrategy(), execute(), and initialize().

ClassifierKMeansStrategy::Parameters te::rp::ClassifierKMeansStrategy::m_parameters
protected

Internal execution parameters.

Definition at line 101 of file ClassifierKMeansStrategy.h.

Referenced by execute(), and initialize().


The documentation for this class was generated from the following files: