| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
TePDIHaralick Class Reference
General purpose algorithms.

Haralick texture features over raster regions. More...

`#include <TePDIHaralick.hpp>`

Inheritance diagram for TePDIHaralick:

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.

typedef std::map< GLCMMatrixCacheKeyT, GLCMMatrixCacheNodeT > TePDIHaralick::GLCMMatrixCacheT`[protected]`

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:

  GLCMMatrixKeyT | A coord pair where x=first pixel value and y=second pixel value.
  double | The pair frequency ( The frequency field must be double type due the matrix normalizing ).

## Member Enumeration Documentation

enum TePDIHaralick::DirectionT

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:

  parameters | The 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:

  band | Raster band.
  pol_index | The polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
  contrastValue | The 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:

  band | Raster band.
  pol_index | The polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
  correlationValue | The 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:

  band | Raster band.
  pol_index | The polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
  dissimilarityValue | The 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:

  band | Raster band.
  pol_index | The polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
  energyValue | The 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:

  band | Raster band.
  pol_index | The polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
  entropyValue | The 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:

  band | Raster band.
  pol_index | The polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
  homogeneityValue | The 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:

  band | Raster band.
  pol_index | The 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:

  band | Raster band.
  pol_index | The polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
  meanValue | The 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:

  band | Raster band.
  pol_index | The polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
  QuiSquareValue | The 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:

  band | Raster band.
  pol_index | The polygon index inside the polygon set ( if no polygon set is present, use de default zero value ).
  ang2ndMomentValue | The 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:

  params | The 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

GLCMMatrixCacheT TePDIHaralick::conc_matrix_cache_`[protected]`

Concurrent matrix cache.

DirectionT TePDIHaralick::direction_`[protected]`

Direction mask.

TePDITypes::TePDIRasterPtrType TePDIHaralick::input_raster_`[protected]`

Input raster pointer.

TePDITypes::TePDIPolygonSetPtrType TePDIHaralick::polygonset_`[protected]`

Polygon set pointer.

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

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/image_processing/TePDIHaralick.hpp
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/image_processing/TePDIHaralick.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines