25 #ifndef __TERRALIB_RP_INTERNAL_CLASSIFIERISOSEGSTRATEGY_H
26 #define __TERRALIB_RP_INTERNAL_CLASSIFIERISOSEGSTRATEGY_H
32 #include "../raster/RasterSynchronizer.h"
38 #include <condition_variable>
41 #include <boost/numeric/ublas/matrix.hpp>
47 class AlgorithmParametersSerializer;
81 BhattacharyyaDistanceType
98 AbstractParameters*
clone()
const;
135 Pattern(
int i,
double a, std::vector<double> mv, boost::numeric::ublas::matrix<double> cm);
236 double getThreshold(
const double acceptanceThreshold,
const unsigned nBands)
const;
249 static void printMatrix(
const boost::numeric::ublas::matrix<double>& matrix);
Raster classifier strategy factory base class.
Raster classifier strategy base class.
Raster ISOSeg Classifier strategy factory.
~ClassifierISOSegStrategyFactory()
ClassifierISOSegStrategyFactory()
te::rp::ClassifierStrategy * build()
Concrete factories (derived from this one) must implement this method in order to create objects.
The parameters passed to the fill regions thread entry.
std::multimap< double, Pattern > * m_outputRegionsPtr
Pointer to the output regions container.
std::vector< unsigned int > const * m_inputRasterBandsPtr
Pointer to the input raster bands do be processed.
std::mutex * m_globalMutexPtr
Pointer to the mutex.
te::rst::RasterSynchronizer * m_inputRasterSyncPtr
Pointer to the input raster sync.
unsigned int * m_runningThreadsCounterPtr
Pointer to variable pointing the current number of running threads.
std::condition_variable * m_condVarPtr
Pointer to the condition variable.
std::size_t * m_nextInputPolIdx2ProcessPtr
Pointer to variable pointing the next polygon index to process.
std::vector< te::gm::Polygon * > const * m_inputPolygonsPtr
FillRegionsThreadEntryParams()
std::mutex * m_condVarMutexPtr
Pointer to the condition variable mutex.
bool m_enableProgress
Pointer to variable pointing the variable to enable or disable the thread internal progress interface...
~FillRegionsThreadEntryParams()
bool * m_continueProcessingFlagPtr
Pointer to variable pointing the variable to allow the process to continue.
bool serialize(AlgorithmParametersSerializer &serializer) const
Returns a parameter serialization object.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
@ MahalanobisDistanceType
Mahalanobis Distance Type.
@ InvalidDistanceType
Invalid distance type.
AbstractParameters * clone() const
Create a clone copy of this instance.
DistanceType m_distanceType
Distance type.
double m_acceptanceThreshold
The acceptance threshold (the closer to 100%, few clusters are created).
const Parameters & operator=(const Parameters ¶ms)
Describes a region or a cluster (group of regions with similar properties) to be used by ISOSeg metho...
double getMahalanobisDistance(Pattern const *const p) const
Returns the Mahalanobis distance between two patterns.
boost::numeric::ublas::matrix< double > m_covarianceMatrix
The covariance matrix between bands.
int m_id
The id of the region of the pattern.
std::vector< double > m_meanVector
The vector of mean values, 1 value per band;.
double getBhattacharyyaDistance(Pattern const *const p) const
Returns the Bhattacharyya distance between two patterns.
void reset()
Reset to initial state.
double m_covarianceMatrixDet
The covariance matrix determinant.
double m_getBhattacharyyaDistance_covsMegeDet
boost::numeric::ublas::matrix< double > m_getBhattacharyyaDistance_meansDif
boost::numeric::ublas::matrix< double > m_covarianceInversion
The inversion of covariance matrix between bands.
Pattern & operator=(const Pattern &rhs)
Pattern * m_myCluster
The associated cluster of this pattern (optional).
Pattern(int i, double a, std::vector< double > mv, boost::numeric::ublas::matrix< double > cm)
Constructor.
double m_area
The area of all regions inside a pattern.
boost::numeric::ublas::matrix< double > m_getBhattacharyyaDistance_covsMege
double m_getBhattacharyyaDistance_distanceValue
boost::numeric::ublas::matrix< double > m_getBhattacharyyaDistance_covsMegeInv
Pattern(const Pattern &rhs)
Copy constructor.
bool operator==(const Pattern &rhs) const
Return true if two clusters are equal.
unsigned int m_getBhattacharyyaDistance_bandIdx
bool operator<(const Pattern &rhs) const
unsigned int m_getBhattacharyyaDistance_nBands
boost::numeric::ublas::matrix< double > m_getBhattacharyyaDistance_distanceTerm1
ISOSeg strategy for OBIA classification. The algorithm orders regions by area (larger first),...
bool initialize(ClassifierStrategyParameters const *const strategyParams)
Initialize the classification strategy.
bool m_isInitialized
True if this instance is initialized.
ClassifierISOSegStrategy()
bool execute()
Executes the classification strategy.
static void fillRegionsThreadEntry(FillRegionsThreadEntryParams *paramsPtr)
Fill regions thread entry.
~ClassifierISOSegStrategy()
double getThreshold(const double acceptanceThreshold, const unsigned nBands) const
ClassifierISOSegStrategy::Parameters m_parameters
Internal execution parameters.
static void printMatrix(const boost::numeric::ublas::matrix< double > &matrix)
Print a matrix to std::out.
Raster classifier strategy factory base class.
Classifier Strategy Parameters.
Raster classifier strategy base class.
An access synchronizer to be used in SynchronizedRaster raster instances.
#define TERPEXPORT
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).