TerraLib 4.1
TePDIHaralick Class Reference

Haralick texture features over raster regions. More...

#include <TePDIHaralick.hpp>

Inheritance diagram for TePDIHaralick:
TePDIAlgorithm

List of all members.

Classes

class  GLCMMatrixCacheNodeT

Public Types

enum  DirectionT {
  NoDirection = 0, North = 1, NorthEast = 2, East = 4,
  SouthEast = 8, South = 16, SouthWest = 32, West = 64,
  NorthWest = 128
}

Public Member Functions

 TePDIHaralick ()
 ~TePDIHaralick ()
 Default Destructor.
bool CheckParameters (const TePDIParameters &parameters) const
 Checks if the supplied parameters fits the requirements of each PDI algorithm implementation.
bool getGLCMEntropy (unsigned int band, unsigned int pol_index, double &entropyValue)
 GLCM Entropy of one polygon inside one band (Reference 1).
bool getGLCMEnergy (unsigned int band, unsigned int pol_index, double &energyValue)
 GLCM Energy (a.k.a GLCM angular second moment) (Reference 2). The energy measures textural uniformity, that is, repetition of pairs of pixel in the image. High values of energy indicate that the distribution of gray level in region in the image has a constant distribution or a periodic form.
bool getGLCMContrast (unsigned int band, unsigned int pol_index, double &contrastValue)
 GLCM Contrast of one polygon inside one band (Reference 4). The contrast is a estimate of the local variations. Average of the squares of the differences between pixels.
bool getGLCMHomogeneity (unsigned int band, unsigned int pol_index, double &homogeneityValue)
 GLCM Homogeneity (a.k.a. Inverse Difference Moment) of one polygon inside one band (Reference 1). This measure of texture results in great values for regions with similar gray level. The contrast and the homogeneity are inversely correlacionad.
bool getGLCMQuiSquare (unsigned int band, unsigned int pol_index, double &QuiSquareValue)
 GLCM QuiSquare of one polygon inside one band. This measure can be understood as a normalization of the energy for the linear dependence of the gray level tones in a region in the image.
bool getGLCMMean (unsigned int band, unsigned int pol_index, double &meanValue)
 GLCM Mean of one polygon inside one band (Reference 3). The GLCM mean is the average expressed in terms of the GLCM.
bool getGLCMDissimilarity (unsigned int band, unsigned int pol_index, double &dissimilarityValue)
 GLCM Dissimilarity of one polygon inside one band (Reference 3). Similar to contrast, but increases linearly. High if the local region has a high contrast.
bool getGLCMStdDev (unsigned int band, unsigned int pol_index, double &stdDevValue)
 GLCM standard deviation (Reference 3). GLCM standard deviation uses the GLCM, therefore it deals specifically with the combinations of reference and neighbor pixels. Thus, it is not the same as the simple standard deviation of gray levels in the original image.
bool getGLCMCorrelation (unsigned int band, unsigned int pol_index, double &correlationValue)
 GLCM correlation (Reference 2).

Protected Types

typedef std::pair< double, double > GLCMMatrixKeyT
typedef std::map
< GLCMMatrixKeyT, double > 
GLCMMatrixT
typedef std::pair< unsigned
int, unsigned int > 
GLCMMatrixCacheKeyT
typedef std::map
< GLCMMatrixCacheKeyT,
GLCMMatrixCacheNodeT
GLCMMatrixCacheT

Protected Member Functions

bool RunImplementation ()
 Runs the current algorithm implementation.
void ResetState (const TePDIParameters &params)
 Reset the internal state to the initial state.
GLCMMatrixCacheNodeT const * getGLCMMatrixNodePtr (unsigned int band, unsigned int pol_index)
 Build a co-ocurrence matrix node using a supplied polygon.
void clear ()

Protected Attributes

DirectionT direction_
 Direction mask.
GLCMMatrixCacheT conc_matrix_cache_
 Concurrent matrix cache.
TePDITypes::TePDIRasterPtrType input_raster_
 Input raster pointer.
TePDITypes::TePDIPolygonSetPtrType polygonset_
 Polygon set pointer.

Detailed Description

Haralick texture features over raster regions.

Author:
Vanessa Oliveira de Souza <vanessa@dpi.inpe.br>
Emiliano F. Castejon <castejon@dpi.inpe.br>
Note:
Reference 1 : Textural Features for Image Classification - Robert M. Haralick, K. Shanmugam, Its'hak Dinstein.
Reference 2: Computer and Robot Vision - Robert M. Haralick - Addison-Wesley Publishing Company
Reference 3: Definiens Developer 7 Reference Book
Reference 4 : Remote Sensing - Models and Methods for Image Processing 2nd Edition - Robert A. Schowengerdt - Academic Press.
The general required parameters are:
Parameters:
input_raster(TePDITypes::TePDIRasterPtrType) Input image - no floating point images allowed.
direction( TePDIHaralick::DirectionT ) - The direction (or direction combination bit-field mask) to be used.
polygonset( TePDITypes::TePDIPolygonSetPtrType ) - Restriction polygon set - The area where to do calcules over all rasters.
Examples:

TePDIHaralick_test.cpp.


Member Typedef Documentation

typedef std::pair< unsigned int, unsigned int > TePDIHaralick::GLCMMatrixCacheKeyT [protected]

Concurrence matrix cache key type.

Concurrence matrix cache type.

typedef std::pair< double, double > TePDIHaralick::GLCMMatrixKeyT [protected]

Concurrence matrix key type( A coord pair where x=first pixel value and y=second pixel value).

typedef std::map< GLCMMatrixKeyT, double > TePDIHaralick::GLCMMatrixT [protected]

Concurrence matrix type.

Parameters:
GLCMMatrixKeyTA coord pair where x=first pixel value and y=second pixel value.
doubleThe pair frequency ( The frequency field must be double type due the matrix normalizing ).

Member Enumeration Documentation

Concurrence matrix used directions

Enumerator:
NoDirection 

Invalid direction.

North 

North direction.

NorthEast 

NorthEast direction.

East 

East direction.

SouthEast 

SouthEast direction.

South 

South direction.

SouthWest 

SouthWest direction.

West 

West direction.

NorthWest 

NorthWest direction.


Constructor & Destructor Documentation

TePDIHaralick::TePDIHaralick ( )
TePDIHaralick::~TePDIHaralick ( )

Default Destructor.


Member Function Documentation

bool TePDIHaralick::CheckParameters ( const TePDIParameters parameters) const [virtual]

Checks if the supplied parameters fits the requirements of each PDI algorithm implementation.

Note:
Error log messages must be generated. No exceptions generated.
Parameters:
parametersThe parameters to be checked.
Returns:
true if the parameters are OK. false if not.

Implements TePDIAlgorithm.

void TePDIHaralick::clear ( ) [protected]

Clear all internal allocated resources.

bool TePDIHaralick::getGLCMContrast ( unsigned int  band,
unsigned int  pol_index,
double &  contrastValue 
)

GLCM Contrast of one polygon inside one band (Reference 4). The contrast is a estimate of the local variations. Average of the squares of the differences between pixels.

Parameters:
bandRaster band.
pol_indexThe polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
contrastValueThe generated value.
Returns:
true if OK, false on errors.
Examples:
TePDIHaralick_test.cpp.
bool TePDIHaralick::getGLCMCorrelation ( unsigned int  band,
unsigned int  pol_index,
double &  correlationValue 
)

GLCM correlation (Reference 2).

Parameters:
bandRaster band.
pol_indexThe polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
correlationValueThe generated value.
Returns:
true if OK, false on errors.
Examples:
TePDIHaralick_test.cpp.
bool TePDIHaralick::getGLCMDissimilarity ( unsigned int  band,
unsigned int  pol_index,
double &  dissimilarityValue 
)

GLCM Dissimilarity of one polygon inside one band (Reference 3). Similar to contrast, but increases linearly. High if the local region has a high contrast.

Parameters:
bandRaster band.
pol_indexThe polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
dissimilarityValueThe generated value.
Returns:
true if OK, false on errors.
Examples:
TePDIHaralick_test.cpp.
bool TePDIHaralick::getGLCMEnergy ( unsigned int  band,
unsigned int  pol_index,
double &  energyValue 
)

GLCM Energy (a.k.a GLCM angular second moment) (Reference 2). The energy measures textural uniformity, that is, repetition of pairs of pixel in the image. High values of energy indicate that the distribution of gray level in region in the image has a constant distribution or a periodic form.

Parameters:
bandRaster band.
pol_indexThe polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
energyValueThe generated value.
Returns:
true if OK, false on errors.
Examples:
TePDIHaralick_test.cpp.
bool TePDIHaralick::getGLCMEntropy ( unsigned int  band,
unsigned int  pol_index,
double &  entropyValue 
)

GLCM Entropy of one polygon inside one band (Reference 1).

Parameters:
bandRaster band.
pol_indexThe polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
entropyValueThe generated value.
Returns:
true if OK, false on errors.
Examples:
TePDIHaralick_test.cpp.
bool TePDIHaralick::getGLCMHomogeneity ( unsigned int  band,
unsigned int  pol_index,
double &  homogeneityValue 
)

GLCM Homogeneity (a.k.a. Inverse Difference Moment) of one polygon inside one band (Reference 1). This measure of texture results in great values for regions with similar gray level. The contrast and the homogeneity are inversely correlacionad.

Parameters:
bandRaster band.
pol_indexThe polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
homogeneityValueThe generated value.
Returns:
true if OK, false on errors.
Examples:
TePDIHaralick_test.cpp.
TePDIHaralick::GLCMMatrixCacheNodeT const * TePDIHaralick::getGLCMMatrixNodePtr ( unsigned int  band,
unsigned int  pol_index 
) [protected]

Build a co-ocurrence matrix node using a supplied polygon.

Parameters:
bandRaster band.
pol_indexThe polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
Returns:
The generated matrix node pointer o NULL on errors.
bool TePDIHaralick::getGLCMMean ( unsigned int  band,
unsigned int  pol_index,
double &  meanValue 
)

GLCM Mean of one polygon inside one band (Reference 3). The GLCM mean is the average expressed in terms of the GLCM.

Parameters:
bandRaster band.
pol_indexThe polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
meanValueThe generated value.
Returns:
true if OK, false on errors.
Examples:
TePDIHaralick_test.cpp.
bool TePDIHaralick::getGLCMQuiSquare ( unsigned int  band,
unsigned int  pol_index,
double &  QuiSquareValue 
)

GLCM QuiSquare of one polygon inside one band. This measure can be understood as a normalization of the energy for the linear dependence of the gray level tones in a region in the image.

Parameters:
bandRaster band.
pol_indexThe polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
QuiSquareValueThe generated value.
Returns:
true if OK, false on errors.
Examples:
TePDIHaralick_test.cpp.
bool TePDIHaralick::getGLCMStdDev ( unsigned int  band,
unsigned int  pol_index,
double &  stdDevValue 
)

GLCM standard deviation (Reference 3). GLCM standard deviation uses the GLCM, therefore it deals specifically with the combinations of reference and neighbor pixels. Thus, it is not the same as the simple standard deviation of gray levels in the original image.

Parameters:
bandRaster band.
pol_indexThe polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
ang2ndMomentValueThe generated value.
Returns:
true if OK, false on errors.
Examples:
TePDIHaralick_test.cpp.
void TePDIHaralick::ResetState ( const TePDIParameters params) [protected, virtual]

Reset the internal state to the initial state.

Parameters:
paramsThe new parameters referente at initial state.

Implements TePDIAlgorithm.

bool TePDIHaralick::RunImplementation ( ) [protected, virtual]

Runs the current algorithm implementation.

Returns:
true if OK. false on error.

Implements TePDIAlgorithm.


Member Data Documentation

Concurrent matrix cache.

Direction mask.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines