te::rp::ClassifierISOSegStrategy Class Reference

ISOSeg strategy for OBIA classification. The algorithm orders regions by area (larger first), and classify the largest region as Cluster 1. All regions similar to this cluster are inserted in Cluster 1, otherwise new Clusters are created. After all regions belong to a cluster, the algorithm merges similar clusters. The acceptance threshold is the only parameter given by the user, and it indicates the maximum distance between two regions to be clustered togheter. More...

#include <ClassifierISOSegStrategy.h>

Inheritance diagram for te::rp::ClassifierISOSegStrategy:
te::rp::ClassifierStrategy

Classes

class  FillRegionsThreadEntryParams
 The parameters passed to the fill regions thread entry. More...
 
class  Parameters
 Classifier Parameters. More...
 
class  Pattern
 Describes a region or a cluster (group of regions with similar properties) to be used by ISOSeg method. More...
 

Public Member Functions

 ClassifierISOSegStrategy ()
 
void enableMultiThread (const bool &enable)
 Enable / disable the use of multiple threads. More...
 
void enableOutputPalette (const bool enabled)
 Enable (true) or disable (false) the creation of a paletted output raster. More...
 
void enableProgressInterface (const bool &enable)
 Enable / disable the progress interface. More...
 
void enableRasterCache (const bool &enable)
 Enable / disable the use of raster data cache. More...
 
bool execute () throw (te::rp::Exception)
 Executes the classification strategy. More...
 
void getMetaData (std::map< std::string, std::string > &metadata) const
 Returns strategy-dependent metadata. More...
 
bool initialize (ClassifierStrategyParameters const *const strategyParams) throw (te::rp::Exception)
 Initialize the classification strategy. More...
 
std::unique_ptr< te::rst::RasterreleaseOutputRaster ()
 Returns a pointer to the output raster or a void pointer if there is none. More...
 
void setInputPolygons (const std::vector< te::gm::Polygon * > &polygonsPtrs)
 Set the input polygons. More...
 
void setInputRaster (const te::rst::Raster &raster)
 Set the input raster. More...
 
void setInputRasterBands (const std::vector< unsigned int > &rasterBands)
 Set the input raste bandsr. More...
 
void setUserOutputPalette (std::vector< te::rst::BandProperty::ColorEntry > &userPalette)
 Set the output user palette. More...
 
 ~ClassifierISOSegStrategy ()
 

Protected Member Functions

bool createOutputRaster (const std::vector< int > &bandsDataTypes, const std::vector< double > &noDataValues)
 Create the output raster using the EXPANSIBLE driver. More...
 
double getThreshold (const double acceptanceThreshold, const unsigned nBands) const
 
bool setOutputRasterPalette (const unsigned int size)
 Create and set the output raster palette folowing the current internal settings. More...
 

Static Protected Member Functions

static void fillRegionsThreadEntry (FillRegionsThreadEntryParams *paramsPtr)
 Fill regions thread entry. More...
 
static void printMatrix (const boost::numeric::ublas::matrix< double > &matrix)
 Print a matrix to std::out. More...
 

Protected Attributes

bool m_createRasterPalette
 Enable (true) or disable (false) the creation of a paletted output raster. More...
 
bool m_enableMultiThread
 Enable or disable the use multipe threads. More...
 
bool m_enableRasterCache
 Enable or disable the use a raster data cache. More...
 
std::vector< te::gm::Polygon * > const * m_inputPolygonsPtr
 Input polygons. More...
 
std::vector< unsigned int > m_inputRasterBands
 Input raster bands. More...
 
te::rst::Raster const * m_inputRasterPtr
 A pointer to the input raster. More...
 
bool m_isInitialized
 True if this instance is initialized. More...
 
std::map< std::string, std::string > m_metaData
 Strategy-dependent metadata. More...
 
std::unique_ptr< te::rst::Rasterm_outputRasterPtr
 A pointer to the output raster. More...
 
ClassifierISOSegStrategy::Parameters m_parameters
 Internal execution parameters. More...
 
bool m_progressInterfaceEnabled
 Progress interface status. More...
 
std::vector< te::rst::BandProperty::ColorEntrym_userOutputPalette
 User output raster palette (it must be large enough to accomodate all classifyier generated classes or an empty vector to automatically generate an random palette. More...
 

Detailed Description

ISOSeg strategy for OBIA classification. The algorithm orders regions by area (larger first), and classify the largest region as Cluster 1. All regions similar to this cluster are inserted in Cluster 1, otherwise new Clusters are created. After all regions belong to a cluster, the algorithm merges similar clusters. The acceptance threshold is the only parameter given by the user, and it indicates the maximum distance between two regions to be clustered togheter.

Definition at line 58 of file ClassifierISOSegStrategy.h.

Constructor & Destructor Documentation

te::rp::ClassifierISOSegStrategy::ClassifierISOSegStrategy ( )
te::rp::ClassifierISOSegStrategy::~ClassifierISOSegStrategy ( )

Member Function Documentation

bool te::rp::ClassifierStrategy::createOutputRaster ( const std::vector< int > &  bandsDataTypes,
const std::vector< double > &  noDataValues 
)
protectedinherited

Create the output raster using the EXPANSIBLE driver.

Parameters
bandsDataTypesBands data types.
noDataValuesA vector of no-data values for each band.
Returns
true if ok,false on errors.
Note
A pointer to the created raster will be handled by m_outputRasterPtr.
void te::rp::ClassifierStrategy::enableMultiThread ( const bool &  enable)
inherited

Enable / disable the use of multiple threads.

Parameters
enableEnable (true) or disable (false) the use of multiple threads.
void te::rp::ClassifierStrategy::enableOutputPalette ( const bool  enabled)
inherited

Enable (true) or disable (false) the creation of a paletted output raster.

Parameters
enabledEnable (true) or disable (false) the creation of a paletted output raster.
void te::rp::ClassifierStrategy::enableProgressInterface ( const bool &  enable)
inherited

Enable / disable the progress interface.

Parameters
enableEnable (true) or disable (false) the progress interface.
void te::rp::ClassifierStrategy::enableRasterCache ( const bool &  enable)
inherited

Enable / disable the use of raster data cache.

Parameters
enableEnable (true) or disable (false) the use of raster cache.
bool te::rp::ClassifierISOSegStrategy::execute ( )
throw (te::rp::Exception
)
virtual

Executes the classification strategy.

Returns
true if OK, false on errors.

Implements te::rp::ClassifierStrategy.

static void te::rp::ClassifierISOSegStrategy::fillRegionsThreadEntry ( FillRegionsThreadEntryParams paramsPtr)
staticprotected

Fill regions thread entry.

Parameters
paramsPtrA pointer to the thread parameters.
Note
Regions with non-invertable covariance matrix will have zero determinants
Regions IDs have the same value as the input polygons indexes
void te::rp::ClassifierStrategy::getMetaData ( std::map< std::string, std::string > &  metadata) const
inherited

Returns strategy-dependent metadata.

Parameters
metadataStrategy-dependent metadata.
double te::rp::ClassifierISOSegStrategy::getThreshold ( const double  acceptanceThreshold,
const unsigned  nBands 
) const
protected
bool te::rp::ClassifierISOSegStrategy::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.

static void te::rp::ClassifierISOSegStrategy::printMatrix ( const boost::numeric::ublas::matrix< double > &  matrix)
staticprotected

Print a matrix to std::out.

std::unique_ptr< te::rst::Raster > te::rp::ClassifierStrategy::releaseOutputRaster ( )
inherited

Returns a pointer to the output raster or a void pointer if there is none.

Returns
Returns a pointer to the output raster or a void pointer if there is none.
Note
The caller of this method must take the ownership of the returned object.
void te::rp::ClassifierStrategy::setInputPolygons ( const std::vector< te::gm::Polygon * > &  polygonsPtrs)
inherited

Set the input polygons.

Parameters
polygonsPtrsInput polygons pointers.
Note
The caller of this method must keep the ownership of the objects.
void te::rp::ClassifierStrategy::setInputRaster ( const te::rst::Raster raster)
inherited

Set the input raster.

Parameters
rasterInput raster.
void te::rp::ClassifierStrategy::setInputRasterBands ( const std::vector< unsigned int > &  rasterBands)
inherited

Set the input raste bandsr.

Parameters
rasterBandsInput raster bands.
bool te::rp::ClassifierStrategy::setOutputRasterPalette ( const unsigned int  size)
protectedinherited

Create and set the output raster palette folowing the current internal settings.

Parameters
sizePalette size.
Returns
true if ok,false on errors.
void te::rp::ClassifierStrategy::setUserOutputPalette ( std::vector< te::rst::BandProperty::ColorEntry > &  userPalette)
inherited

Set the output user palette.

Parameters
userPaletteUser output raster palette (it must be large enough to accomodate all classifyier generated classes or an empty vector to automatically generate an random palette.

Member Data Documentation

bool te::rp::ClassifierStrategy::m_createRasterPalette
protectedinherited

Enable (true) or disable (false) the creation of a paletted output raster.

Definition at line 157 of file ClassifierStrategy.h.

bool te::rp::ClassifierStrategy::m_enableMultiThread
protectedinherited

Enable or disable the use multipe threads.

Definition at line 152 of file ClassifierStrategy.h.

bool te::rp::ClassifierStrategy::m_enableRasterCache
protectedinherited

Enable or disable the use a raster data cache.

Definition at line 147 of file ClassifierStrategy.h.

std::vector<te::gm::Polygon*> const* te::rp::ClassifierStrategy::m_inputPolygonsPtr
protectedinherited

Input polygons.

Definition at line 172 of file ClassifierStrategy.h.

std::vector<unsigned int> te::rp::ClassifierStrategy::m_inputRasterBands
protectedinherited

Input raster bands.

Definition at line 167 of file ClassifierStrategy.h.

te::rst::Raster const* te::rp::ClassifierStrategy::m_inputRasterPtr
protectedinherited

A pointer to the input raster.

Definition at line 137 of file ClassifierStrategy.h.

bool te::rp::ClassifierISOSegStrategy::m_isInitialized
protected

True if this instance is initialized.

Definition at line 228 of file ClassifierISOSegStrategy.h.

std::map< std::string, std::string > te::rp::ClassifierStrategy::m_metaData
protectedinherited

Strategy-dependent metadata.

Definition at line 177 of file ClassifierStrategy.h.

std::unique_ptr< te::rst::Raster > te::rp::ClassifierStrategy::m_outputRasterPtr
protectedinherited

A pointer to the output raster.

Definition at line 162 of file ClassifierStrategy.h.

ClassifierISOSegStrategy::Parameters te::rp::ClassifierISOSegStrategy::m_parameters
protected

Internal execution parameters.

Definition at line 229 of file ClassifierISOSegStrategy.h.

bool te::rp::ClassifierStrategy::m_progressInterfaceEnabled
protectedinherited

Progress interface status.

Definition at line 142 of file ClassifierStrategy.h.

std::vector< te::rst::BandProperty::ColorEntry > te::rp::ClassifierStrategy::m_userOutputPalette
protectedinherited

User output raster palette (it must be large enough to accomodate all classifyier generated classes or an empty vector to automatically generate an random palette.

Definition at line 182 of file ClassifierStrategy.h.


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