26#ifndef __TERRALIB_CLASSIFICATION_INTERNAL_ISODATA_H 
   27#define __TERRALIB_CLASSIFICATION_INTERNAL_ISODATA_H 
   30#include "../common/AbstractParameters.h" 
   31#include "../common/MatrixUtils.h" 
   32#include "../common/progress/TaskProgress.h" 
   81            AbstractParameters* 
clone() 
const;
 
  130                      const std::vector<unsigned int>& attributesIndices,
 
  131                      const std::vector< double >& inputNoDataValues,
 
  133                      const unsigned int outputIndex,
 
  135                      const bool enableProgressInterface,
 
  136                      std::vector< ClusterData >* clustersDataPtr );
 
  143        typedef std::map< ClusterData::ClusterLabelT, ISOData::ClusterData >
 
  164          const std::vector<unsigned int>& attributesIndices,
 
  167          const std::vector<double>& inputNoDataValues,
 
  168          std::vector< std::pair< double, double > >& inputElementsOffsetsAndGains ) 
const;
 
  184          const std::vector<unsigned int>& attributesIndices,
 
  185          const std::vector<double>& inputNoDataValues,
 
  188          const unsigned int outputIndex,
 
  189          const unsigned int outputNoDataValue,
 
  190          const std::vector< std::pair< double, double > >& inputElementsOffsetsAndGains ) 
const;
 
  199          const unsigned int inputElelementsCount,
 
  216          const std::vector<unsigned int>& attributesIndices,
 
  217          const std::vector<double>& inputNoDataValues,
 
  220          const unsigned int outputIndex,
 
  221          const std::vector< std::pair< double, double > >& inputElementsOffsetsAndGains ) 
const;
 
  233          const unsigned int inputElementsCount,
 
  234          const unsigned int maxNumberOfSplits,
 
  247          const double mergeDistThreshold,
 
  248          const unsigned int maxNumberOfMerges,
 
std::vector< double > m_sums
Sums of all cluster pixel values(one sum for each cluster feature dimention).
 
unsigned int m_size
Cluster size (elements number).
 
unsigned int ClusterLabelT
 
ClusterLabelT m_label
Cluster label.
 
std::vector< double > m_means
Cluster means (one for each cluster feature dimention).
 
double m_avgDistToClusterCenter
Average distance from all samples to the cluster center.
 
std::vector< double > m_stdDevs
Cluster standart deviations (one for each cluster feature dimention).
 
const Parameters & operator=(const Parameters ¶ms)
 
unsigned int m_maxSplitsPerIteration
Maximum number of clusters splits per iteration (zero=automatic, defaul:1 ).
 
unsigned int m_clustersNumber
Desired number of clusters (This is a mean number. Final clusters number can go from 0 up to k+(k/2)....
 
unsigned int m_maxIterationsNumber
Maximum number of iterations (minimum:1, default:0=automatic).
 
double m_minClusterSizePercent
Minimum cluster size (percentual proportion related to the total input elments size....
 
AbstractParameters * clone() const
Create a clone copy of this instance.
 
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
 
double m_stdDevSplitThreshold
A standart deviation threshold to split clusters (lower values tend to create more clusters by splitt...
 
unsigned int m_maxMergesPerIteration
Maximum number of clusters merges per iteration (zero=automatic, defaul:1 ).
 
double m_mergeDistThreshold
A distance treshold to control the merge process (higher values will allow to merge more clusters....
 
ISOData strategy for an unsupervised pixel-based classification algorithm.
 
bool classify(const InputAdaptor< double > &input, const std::vector< unsigned int > &attributesIndices, const std::vector< double > &inputNoDataValues, InputOutputAdaptor< ClusterData::ClusterLabelT > &output, const unsigned int outputIndex, const ClusterData::ClusterLabelT outputNoDataValue, const bool enableProgressInterface, std::vector< ClusterData > *clustersDataPtr)
Classify an input iterated data and save the result on the output iterated data.
 
std::map< ClusterData::ClusterLabelT, ISOData::ClusterData > ClustersContainerT
 
bool removeSmallClusters(const unsigned int inputElelementsCount, ClustersContainerT &clustersMap) const
Remove too mall clusters following the current parameters.
 
static void recodeClustersLabels(ClustersContainerT &clustersMap)
Recode clusters labels to be in range zero up to the number of clusters - 1.
 
bool updateClustersStats(const InputAdaptor< double > &input, const std::vector< unsigned int > &attributesIndices, const std::vector< double > &inputNoDataValues, ClustersContainerT &clustersMap, const InputOutputAdaptor< unsigned int > &output, const unsigned int outputIndex, const std::vector< std::pair< double, double > > &inputElementsOffsetsAndGains) const
Update clusters statistical data.
 
static void printClusters(const ClustersContainerT &clustersMap)
 
bool initialize(const Parameters ¶ms)
Initialize this classifier instance with new parameters.
 
static bool mergeClusters(const double mergeDistThreshold, const unsigned int maxNumberOfMerges, ClustersContainerT &clustersMap)
Merge clusters.
 
bool initializeClusters(const InputAdaptor< double > &input, const std::vector< unsigned int > &attributesIndices, ClustersContainerT &clustersMap, ClusterData::ClusterLabelT &nextAvaliableClusterLabel, const std::vector< double > &inputNoDataValues, std::vector< std::pair< double, double > > &inputElementsOffsetsAndGains) const
Initialize clusters.
 
Parameters m_parameters
Internal execution parameters.
 
bool splitClusters(const unsigned int inputElementsCount, const unsigned int maxNumberOfSplits, ClusterData::ClusterLabelT &nextAvaliableClusterLabel, ClustersContainerT &clustersMap) const
Split clusters.
 
bool classifyElements(const InputAdaptor< double > &input, const std::vector< unsigned int > &attributesIndices, const std::vector< double > &inputNoDataValues, ClustersContainerT &clustersMap, InputOutputAdaptor< unsigned int > &output, const unsigned int outputIndex, const unsigned int outputNoDataValue, const std::vector< std::pair< double, double > > &inputElementsOffsetsAndGains) const
Classify each element following clusers centers.
 
void reset()
Reset this instance to its initial state.
 
bool m_isInitialized
True if this instance is initialized.
 
Abstract parameters base interface.
 
#define TECLEXPORT
You can use this macro in order to export/import classes and functions from this module.
 
Proxy configuration file for TerraView (see terraview_config.h).
 
An exception class for the XML module.