Go to the documentation of this file.
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,
263 #endif // __TERRALIB_CLASSIFICATION_INTERNAL_ISODATA_H
double m_minClusterSizePercent
Minimum cluster size (percentual proportion related to the total input elments size....
std::vector< double > m_stdDevs
Cluster standart deviations (one for each cluster feature dimention).
unsigned int m_maxSplitsPerIteration
Maximum number of clusters splits per iteration (zero=automatic, defaul:1 ).
static bool mergeClusters(const double mergeDistThreshold, const unsigned int maxNumberOfMerges, ClustersContainerT &clustersMap)
Merge clusters.
static void printClusters(const ClustersContainerT &clustersMap)
static void recodeClustersLabels(ClustersContainerT &clustersMap)
Recode clusters labels to be in range zero up to the number of clusters - 1.
ClusterLabelT m_label
Cluster label.
ISOData strategy for an unsupervised pixel-based classification algorithm.
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.
unsigned int m_maxIterationsNumber
Maximum number of iterations (minimum:1, default:0=automatic).
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)....
double m_mergeDistThreshold
A distance treshold to control the merge process (higher values will allow to merge more clusters....
unsigned int m_size
Cluster size (elements number).
unsigned int m_maxMergesPerIteration
Maximum number of clusters merges per iteration (zero=automatic, defaul:1 ).
bool splitClusters(const unsigned int inputElementsCount, const unsigned int maxNumberOfSplits, ClusterData::ClusterLabelT &nextAvaliableClusterLabel, ClustersContainerT &clustersMap) const
Split clusters.
const Parameters & operator=(const Parameters ¶ms)
unsigned int ClusterLabelT
An exception class for the XML module.
void reset()
Reset this instance to its initial state.
double m_avgDistToClusterCenter
Average distance from all samples to the cluster center.
bool initialize(const Parameters ¶ms)
Initialize this classifier instance with new parameters.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
Parameters m_parameters
Internal execution parameters.
bool m_isInitialized
True if this instance is initialized.
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.
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.
AbstractParameters * clone() const
Create a clone copy of this instance.
double m_stdDevSplitThreshold
A standart deviation threshold to split clusters (lower values tend to create more clusters by splitt...
Proxy configuration file for TerraView (see terraview_config.h).
std::vector< double > m_means
Cluster means (one for each cluster feature dimention).
bool removeSmallClusters(const unsigned int inputElelementsCount, ClustersContainerT &clustersMap) const
Remove too mall clusters following the current parameters.
Abstract parameters base interface.
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.
std::vector< double > m_sums
Sums of all cluster pixel values(one sum for each cluster feature dimention).
std::map< ClusterData::ClusterLabelT, ISOData::ClusterData > ClustersContainerT
#define TECLEXPORT
You can use this macro in order to export/import classes and functions from this module.