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...
 
std::vector< int > getOutputDataTypes () const
 Returns the output raster pixel data type for each output band. More...
 
bool initialize (ClassifierStrategyParameters 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 ( )
te::rp::ClassifierKMeansStrategy::~ClassifierKMeansStrategy ( )

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

Executes the classification strategy.

Parameters
inputRasterInput raster.
inputRasterBandsInput raster bands.
inputPolygonsThe polygons to be classified when using object-based image analysis (OBIA).
outputRasterOutput raster.
outputRasterBandOutput raster band.
enableProgressInterfaceEnable the internal strategy to update the progress interface.
Returns
true if OK, false on errors.

Implements te::rp::ClassifierStrategy.

std::vector< int > te::rp::ClassifierKMeansStrategy::getOutputDataTypes ( ) const
virtual

Returns the output raster pixel data type for each output band.

Returns
Returns the output raster pixel data type for each output band.

Implements te::rp::ClassifierStrategy.

bool te::rp::ClassifierKMeansStrategy::initialize ( ClassifierStrategyParameters 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.

Member Data Documentation

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

True if this instance is initialized.

Definition at line 103 of file ClassifierKMeansStrategy.h.

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

Internal execution parameters.

Definition at line 104 of file ClassifierKMeansStrategy.h.


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