| TerraLib 4.1

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

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/image_processing/TePDIHaralick.hpp
Go to the documentation of this file.

    00001 /*
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular
    00017 purpose. The library provided hereunder is on an "as is" basis, and the
    00018 authors have no obligation to provide maintenance, support, updates,
    00019 enhancements, or modifications.
    00020 In no event shall INPE be held liable to any party
    00021 for direct, indirect, special, incidental, or consequential damages arising
    00022 out of the use of this library and its documentation.
    00023 */
    00024
    00025 #ifndef TEPDIHARALICK_HPP
    00026   #define TEPDIHARALICK_HPP
    00027
    00028   #include "TePDIAlgorithm.hpp"
    00029   #include "TePDIParameters.hpp"
    00030   #include "TePDITypes.hpp"
    00031
    00032   #include <map>
    00033
    00060   class PDI_DLL TePDIHaralick : public TePDIAlgorithm
    00061   {
    00062     public :
    00063
    00065       enum DirectionT
    00066       {
    00068         NoDirection = 0,
    00070         North = 1,
    00072         NorthEast = 2,
    00074         East = 4,
    00076         SouthEast = 8,
    00078         South = 16,
    00080         SouthWest = 32,
    00082         West = 64,
    00084         NorthWest = 128
    00085       };
    00086
    00087       TePDIHaralick();
    00088
    00092       ~TePDIHaralick();
    00093
    00103       bool CheckParameters( const TePDIParameters& parameters ) const;
    00104
    00114       bool getGLCMEntropy( unsigned int band, unsigned int pol_index,
    00115         double& entropyValue );
    00116
    00129       bool getGLCMEnergy( unsigned int band, unsigned int pol_index,
    00130         double& energyValue );
    00131
    00143       bool getGLCMContrast( unsigned int band, unsigned int pol_index,
    00144         double& contrastValue );
    00145
    00158       bool getGLCMHomogeneity( unsigned int band, unsigned int pol_index,
    00159         double& homogeneityValue );
    00160
    00172       bool getGLCMQuiSquare( unsigned int band, unsigned int pol_index,
    00173         double& QuiSquareValue );
    00174
    00185       bool getGLCMMean( unsigned int band, unsigned int pol_index,
    00186         double& meanValue );
    00187
    00200       bool getGLCMDissimilarity( unsigned int band, unsigned int pol_index,
    00201         double& dissimilarityValue );
    00202
    00215       bool getGLCMStdDev( unsigned int band, unsigned int pol_index,
    00216         double& stdDevValue );
    00217
    00226       bool getGLCMCorrelation( unsigned int band, unsigned int pol_index,
    00227         double& correlationValue );
    00228
    00229     protected :
    00230
    00235       typedef std::pair< double, double > GLCMMatrixKeyT;
    00236
    00244       typedef std::map< GLCMMatrixKeyT, double > GLCMMatrixT;
    00245
    00249       typedef std::pair< unsigned int, unsigned int > GLCMMatrixCacheKeyT;
    00250
    00252       class GLCMMatrixCacheNodeT
    00253       {
    00254         public :
    00255
    00257           GLCMMatrixT matrix_;
    00258
    00261           double rasterMinGray_;
    00262
    00265           double rasterMaxGray_;
    00266
    00269           unsigned int coOcurrences_;
    00270
    00271           GLCMMatrixCacheNodeT()
    00272           : rasterMinGray_( DBL_MAX ), rasterMaxGray_( -1.0 * DBL_MAX ),
    00273           coOcurrences_( 0 )
    00274           {};
    00275
    00276           ~GLCMMatrixCacheNodeT() {};
    00277       };
    00278
    00282       typedef std::map< GLCMMatrixCacheKeyT, GLCMMatrixCacheNodeT >
    00283         GLCMMatrixCacheT;
    00284
    00286       DirectionT direction_;
    00287
    00289       GLCMMatrixCacheT conc_matrix_cache_;
    00290
    00292       TePDITypes::TePDIRasterPtrType input_raster_;
    00293
    00295       TePDITypes::TePDIPolygonSetPtrType polygonset_;
    00296
    00302       bool RunImplementation();
    00303
    00309       void ResetState( const TePDIParameters& params );
    00310
    00319       GLCMMatrixCacheNodeT const* getGLCMMatrixNodePtr( unsigned int band,
    00320         unsigned int pol_index );
    00321
    00323       void clear();
    00324
    00325   };
    00326
    00327 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines