| 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/TePDISAMClassifier.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 TEPDISAMCLASSIFIER_HPP
    00026   #define TEPDISAMCLASSIFIER_HPP
    00027
    00028   #include "TePDIAlgorithm.hpp"
    00029   #include "TePDIMatrix.hpp"
    00030
    00031   #include "../kernel/TeSharedPtr.h"
    00032   #include "../kernel/TeThread.h"
    00033   #include "../kernel/TeMutex.h"
    00034
    00035   #include <vector>
    00036
    00067   class PDI_DLL TePDISAMClassifier : public TePDIAlgorithm
    00068   {
    00069
    00070     public :
    00071
    00076       class PDI_DLL ClassSpectralSamples
    00077       {
    00078         public :
    00079
    00086           unsigned int classId_;
    00087
    00095           double maxAngularDist_;
    00096
    00102           TePDIMatrix< double > samplesMatrix_;
    00103
    00104           ClassSpectralSamples();
    00105
    00106           ~ClassSpectralSamples();
    00107       };
    00108
    00112       typedef std::vector< ClassSpectralSamples > SpectralSamplesVectorT;
    00113
    00117       typedef TeSharedPtr< SpectralSamplesVectorT > SpectralSamplesVecPtrT;
    00118
    00119       TePDISAMClassifier();
    00120
    00121       ~TePDISAMClassifier();
    00122
    00123       // Overloaded
    00124       bool CheckParameters(const TePDIParameters& parameters) const;
    00125
    00126     protected :
    00127
    00132       class PDI_DLL ClassReferenceData
    00133       {
    00134         public :
    00135
    00142           unsigned int classId_;
    00143
    00151           double maxAngularDist_;
    00152
    00156           std::vector< double > samplesMeansVec_;
    00157
    00158           ClassReferenceData();
    00159
    00160           ~ClassReferenceData();
    00161       };
    00162
    00167       class PDI_DLL SegThread : public TeThread
    00168       {
    00169         public :
    00170
    00171           SegThread( bool progEnabled, TeRaster& inRaster,
    00172             const std::vector< unsigned int >& inRasterBands,
    00173             const std::vector< ClassReferenceData >& refDataVector,
    00174             TeMutex& inMutex, TeMutex& outMutex,
    00175             std::vector< bool >& linesProcStatusVec, volatile bool& abortFlag,
    00176             TeRaster& outRaster );
    00177
    00178           ~SegThread();
    00179
    00180           inline bool getReturnValue() const
    00181           {
    00182             return returnValue_;
    00183           };
    00184
    00185           //overload
    00186           void run();
    00187
    00188         protected :
    00189
    00191           bool progEnabled_;
    00192
    00195           volatile bool returnValue_;
    00196
    00198           TeRaster& inRaster_;
    00199
    00201           const std::vector< unsigned int >& inRasterBands_;
    00202
    00204           const std::vector< ClassReferenceData >& refDataVector_;
    00205
    00207           TeMutex& inMutex_;
    00208
    00210           TeMutex& outMutex_;
    00211
    00213           std::vector< bool >& linesProcStatusVec_;
    00214
    00216           volatile bool& abortFlag_;
    00217
    00219           TeRaster& outRaster_;
    00220       };
    00221
    00222       //Overloaded
    00223       void ResetState( const TePDIParameters& );
    00224
    00225       //Overloaded
    00226       bool RunImplementation();
    00227
    00234       bool calcClassRefData( const SpectralSamplesVectorT& spectralSamples,
    00235         std::vector< ClassReferenceData >& refDataVector ) const;
    00236   };
    00237
    00238 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines